-- ALTER TABLE erp1.accountmovement AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.accountmovementkind AUTO_INCREMENT = 4;
-- ALTER TABLE erp1.accountstree AUTO_INCREMENT = 420;
-- ALTER TABLE erp1.accountstreefromprog AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.accountstreesetting AUTO_INCREMENT = 7;
-- ALTER TABLE erp1.ads AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.area AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.assets AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.assetscat AUTO_INCREMENT = 25;
-- ALTER TABLE erp1.assetssale AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.availableparcode AUTO_INCREMENT = 100001;
-- ALTER TABLE erp1.bank AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.bankaccount AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.beneficiaries AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.beneficiaries_eco AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.beneficiaries_family AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billname AUTO_INCREMENT = 7;
-- ALTER TABLE erp1.billoperation AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billprint AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billprinter AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billproperty AUTO_INCREMENT = 130;
-- ALTER TABLE erp1.bills AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billsbuy AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.billsettings AUTO_INCREMENT = 1196;
-- 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 = 27;
-- ALTER TABLE erp1.buybillcurr AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.buybilldetail AUTO_INCREMENT = 27;
-- ALTER TABLE erp1.buybilldetailoffer AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.buybilloffer AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.buypriceshistorybook AUTO_INCREMENT = 26;
-- ALTER TABLE erp1.capital AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.carfile AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.carreview AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.carreviewer AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.cars AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.cartracking AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.cashtransfer AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.charities AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.charitiescenter AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.charitysearchlog AUTO_INCREMENT = 1;
-- 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 = 3;
-- ALTER TABLE erp1.clientarea AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.clientdebtchange AUTO_INCREMENT = 31;
-- ALTER TABLE erp1.clientdetails AUTO_INCREMENT = 2;
-- 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 = 2;
-- ALTER TABLE erp1.dailyentry AUTO_INCREMENT = 51;
-- ALTER TABLE erp1.dailyentrycreditor AUTO_INCREMENT = 51;
-- ALTER TABLE erp1.dailyentrydebtor AUTO_INCREMENT = 51;
-- ALTER TABLE erp1.damagedproduct AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.datedchecked AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.discountcontrol AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.disease AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.doctorkashf AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.dollarearnings AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.ebillsetting AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.eclientsetting AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.employee AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.employeeattendance AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.employeeattendancesystem AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.employeeclosedaygroupstatus AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.employeeclosedayhistory AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.employeeclosedaystatus AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.employeeclosedaysubgroupstatus AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.employeedoctor AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.employeedoctordebtandpay AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.employeedoctordebtchange AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.employeegroup AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.employeepersonnel AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.employeesubgroup AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.entryproductspurchased AUTO_INCREMENT = 26;
-- ALTER TABLE erp1.expenseexchange AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.expenses AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.expensestype AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.faida AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.faidadirector AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.faidaproduct AUTO_INCREMENT = 3;
-- ALTER TABLE erp1.goverarea AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.government AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.importcontract AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.impotencetreatmentsuppliersave AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.income AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.incometype AUTO_INCREMENT = 8;
-- ALTER TABLE erp1.insurancecompanies AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.kashf AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.kempiala AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.knownways AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.languages AUTO_INCREMENT = 3;
-- ALTER TABLE erp1.lastbillidspricesupdated AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.lastbillidsquickprofit AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_check AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_comreceipt AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_comreceiptdetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_comreceiptimage AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_externalmaintenance AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_finishingpayed AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_handedreport AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_initialmaintenance AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_initialmaintenancedetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_insurance AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_maintenancereceipt AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_maintenancereceiptfinish AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_producthistory AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_stage AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.m_stageproperity AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.maccontrol AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.maintenancecases AUTO_INCREMENT = 5;
-- ALTER TABLE erp1.maintenancecenters AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.maintenancecomments AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.maintenancecompanies AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.maintenancepolicys AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.maintenanceprocedures AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.maintenances AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.manufacuresetting AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.menuurl AUTO_INCREMENT = 31;
-- ALTER TABLE erp1.movementmanage AUTO_INCREMENT = 430;
-- ALTER TABLE erp1.movementmanagedeleted AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.newdbbackup AUTO_INCREMENT = 3;
-- ALTER TABLE erp1.newdbname AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.notics AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.offerpricebill AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.offerpricebillprop AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.offerpricecondition AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.onlinecat AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.onlineproductcat AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.onlinestoresetting AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.onlinetempcategory AUTO_INCREMENT = 5;
-- ALTER TABLE erp1.onlinetemporder AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.onlinetemporderclient AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.onlinetemporderproduct AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.onlinetempproduct AUTO_INCREMENT = 7;
-- ALTER TABLE erp1.onlinetempstoredetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.onlinetempstorereport AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.otherrequest AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.otherstoremovement AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.pages AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.partner AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.partnertransferbetween AUTO_INCREMENT = 25;
-- ALTER TABLE erp1.partnerwithdrawal AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.paymentnetworks AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.playstationcard AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.playstationclientcard AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.playstationclientcardpayhistory AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.policy AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.premium AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.premiumautomatic AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.premiumclient AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.premiuminstallments AUTO_INCREMENT = 24;
-- ALTER TABLE erp1.product AUTO_INCREMENT = 7;
-- ALTER TABLE erp1.productcat AUTO_INCREMENT = 4;
-- ALTER TABLE erp1.productcatunit AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.productingredients AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productionexecution AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productionexecutionoutput AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productionexecutionproduct AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productionexecutionwaste AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productionorder AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productionout AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productionoutdetails AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productionoutmany AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productionoutmanyinproducts AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productionoutmanyoutproducts AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productionrate AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productionrateproduct AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productrecieve AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productrequests AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productserial AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productsetting AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productstore AUTO_INCREMENT = 4;
-- ALTER TABLE erp1.producttemp AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.producttempunit AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.productunit AUTO_INCREMENT = 7;
-- ALTER TABLE erp1.programsettings AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.project AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.projectexchmaterial AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.projectexchmaterialdetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.projectexchmaterialdetailreturn AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.projectexchmaterialreturn AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.projectkind AUTO_INCREMENT = 4;
-- ALTER TABLE erp1.properties AUTO_INCREMENT = 688;
-- ALTER TABLE erp1.qrerpuserpass AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.quickprofitclient AUTO_INCREMENT = 23;
-- ALTER TABLE erp1.quickprofitday AUTO_INCREMENT = 23;
-- ALTER TABLE erp1.quickprofitgeneral AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.quickprofitproduct AUTO_INCREMENT = 30;
-- ALTER TABLE erp1.quickprofitstore AUTO_INCREMENT = 30;
-- ALTER TABLE erp1.religions AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.relusergroupproperties AUTO_INCREMENT = 3224;
-- ALTER TABLE erp1.rentbill AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.rentbillprop AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.rentproduct AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.rentstore AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.representativecompany AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.restauranthall AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.restaurantkitchenprint AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.restaurantorder AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.restaurantorderdeliverydetails AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.restaurantorderdetails AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.restaurantplaystation AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.restaurantplaystationplay AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.restaurantprinter AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.restaurantrawdestruction AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.restauranttable AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.resturantcategory AUTO_INCREMENT = 4;
-- ALTER TABLE erp1.returnbuybill AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.returnbuybillcurr AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.returnbuybilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.returnsellbill AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.returnsellbillcurr AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.returnsellbilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.returnsellbillreview AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.richproperity AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.salaryreport AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.saudielectronicinvoice AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.save AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.saveclose AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.savedaily AUTO_INCREMENT = 26;
-- ALTER TABLE erp1.savestock AUTO_INCREMENT = 5;
-- ALTER TABLE erp1.savetype AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.searchfilters AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sellandruternbilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sellbill AUTO_INCREMENT = 29;
-- ALTER TABLE erp1.sellbillandreturnreview AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sellbillandrutern AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sellbillandruterncurr AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sellbillcurr AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sellbilldetail AUTO_INCREMENT = 33;
-- ALTER TABLE erp1.sellbilldetailoffer AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sellbilldetailorder AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sellbilldetailtax AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sellbillimage AUTO_INCREMENT = 9;
-- ALTER TABLE erp1.sellbilloffer AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sellbillorder AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sellbillpayed AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sellbillreview AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sellbillstatus AUTO_INCREMENT = 26;
-- ALTER TABLE erp1.sellbillview AUTO_INCREMENT = ;
-- ALTER TABLE erp1.settingoperation AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.shippercompanies AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.shippingfile AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.simplemanufacturesetting AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.sizecolor AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sizecolorstoredetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sliders AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.soldserialproduct AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sparepart AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sparepartstore AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.sparepartstoredetails AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.sparepartstorereport AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.stage AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.stagestep AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.stock_import_logs AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.store AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.storedetail AUTO_INCREMENT = 7;
-- ALTER TABLE erp1.storemovement AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.storemovement_main AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.storereport AUTO_INCREMENT = 60;
-- ALTER TABLE erp1.studentabsences AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.studentaddsubjectdetails AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.studentaddsubjects AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.students AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.studentsetting AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.studentsexams AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.studentsexamsval AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.studentspaymentsystems AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.studentspays AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.studentsubjectgroupdays AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.studentsubjectgroups AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.studentsubjects AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.subvention AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.subventionpay AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.suppay AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.supplier AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.supplierdebtchange AUTO_INCREMENT = 23;
-- ALTER TABLE erp1.supplieropen AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.supplieropendebtchange AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.supplieropenexchangeorclosing AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.tamweenbill AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.tamweenclientdetail AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.tamweenda3mstatus AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.tamweenremainstatus AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.taskorder AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.taskorderproducts AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.taskscases AUTO_INCREMENT = 6;
-- ALTER TABLE erp1.temreturnsellbill AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.temreturnsellbilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.temsellandruternbilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.temsellbill AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.temsellbillandrutern AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.temsellbilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.toworkshoporder AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.toworkshoporderbill AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.transferbtweenbankaccount AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.transferclientaccounts AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.transfermoney AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.typeclient AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.typesimpotencetreatment AUTO_INCREMENT = 4;
-- ALTER TABLE erp1.typesupplier AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.unit AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.user AUTO_INCREMENT = 2;
-- ALTER TABLE erp1.usergroup AUTO_INCREMENT = 5;
-- ALTER TABLE erp1.usergroupadmin AUTO_INCREMENT = 1029;
-- ALTER TABLE erp1.vatpayment AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.wishlist AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.workshop AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.workstation AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.workstationassets AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.workstationworker AUTO_INCREMENT = 1;
-- ALTER TABLE erp1.youtube_link AUTO_INCREMENT = 290;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:10:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:40:56", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:11:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:41:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:11:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:41:17", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:15:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:45:49", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:16:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:46:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:17:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:47:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:18:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:48:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:18:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:48:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:19:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:49:03", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:20:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:50:20", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:20:32";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:50:32", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:21:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:51:05", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:21:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:51:17", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:21:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:51:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:21:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:51:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:21:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:51:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:22:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:52:34", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:23:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:53:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:23:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:53:18", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:23:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:53:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:23:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:53:33", deviceType = "DESKTOP" WHERE userid = -1;

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06947dfb8a00b5
-- ----------------------------------------------------------------------------------------------------

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-21 13:53:33', '06947dfb8a00b5', '1', '0.00', '0', '0', '1', '130.00', '130', '130', '0', '1', '2025-12-21 13:53:33', '', '-1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','130','0','','0','0','130','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2025-12-21','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=29
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','اضافة فاتورة مبيعات','29', '0', '2025-12-21 13:53:33', '-1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '130', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-21 13:53:33','0','0','',''); -- id=31
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', '29', '3', '5', '1', '120', '120', '0', '', '0', '2025-12-21 13:53:33', '5', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','0','0','0','0','120','120','0','','0','','0','0','0','0'); -- id=33
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 = 33;
 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-21', 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-21', 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;
UPDATE storedetail SET  productquantity = '-2', userid = '-1', storedetaildate = '2025-12-21 13:53:33' WHERE storedetailid = '5';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('5', '1', '1', '1', '29', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-1', '-2', '-1', '2025-12-21 13:53:33','0','0'); -- id=60
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where 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 ('10','00004', '29', '3', '4', '1', '10', '10', '0', '', '0', '2025-12-21 13:53:33', '4', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','3-1,','0','0','0','0','10','10','0','','0','','0','0','0','0'); -- id=34
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 = 34;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4, '2025-12-21', 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-21', 10, 10, 10
                    , 10, 10, 10, 10
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 10, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10, sellCostBuyPrice =sellCostBuyPrice+10
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '-1', storedetaildate = '2025-12-21 13:53:33' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '1', '1', '29', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13', '12', '-1', '2025-12-21 13:53:33','0','0'); -- id=61
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1270',  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 ('1140','130', '0', '1', 'اضافة فاتورة مبيعات', '29', '1270', '2025-12-21 13:53:33', '-1',  'sellbillController.php','1','','0'); -- id=26
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '130', '130', '2025-12-21', '-1', '0', '0', '2025-12-21 13:53:33','اضافة فاتورة مبيعات رقم 29','1','0',null,'0','29','sellbillController.php?do=showDetail&sellbillid=29'); -- id=51
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('51', '383', '130', '','0'); -- id=51
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '1260', 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 ('51', '143', '130', '','0'); -- id=51
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '790', 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 ( '110', '110', '2025-12-21', '-1', '0', '0', '2025-12-21 13:53:33','اضافة فاتورة مبيعات رقم 29 - صرف البضاعة من المخزن','1','0',null,'0','29','sellbillController.php?do=showDetail&sellbillid=29'); -- id=52
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('52', '402', '110', '','0'); -- id=52
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '-149', theOrder = '0', layingOrder = '510104', 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 ('52', '382', '110', '','0'); -- id=52
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '10149', 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='51,0,52' where sellbillid=29;
 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-21', 130, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+130, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+110
                        , returnSellVal = returnSellVal+0, 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-21', 130, 110, 110
                    , 110, 110, 110, 110
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,110, 110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+130, sellCostBuyPrice =sellCostBuyPrice+110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+110
                        , returnSellVal = returnSellVal+0, 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, 130, 110, 110
                    , 110, 110, 110, 110, 110, 110)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+130, netSellCostBuyPrice = netSellCostBuyPrice+110
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+110
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+110
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+110
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+110
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+110
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+110
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+110;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06947dfb8a00b5 and sellbillId = 29 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:23:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:53:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:23:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:53:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:23:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:53:58", deviceType = "DESKTOP" WHERE userid = -1;

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06947dfcbb4e8a
-- ----------------------------------------------------------------------------------------------------

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-21 13:53:58', '06947dfcbb4e8a', '1', '0.00', '0', '0', '1', '10.00', '10', '10', '0', '1', '2025-12-21 13:53:58', '', '-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-21','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=30
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','اضافة فاتورة مبيعات','30', '0', '2025-12-21 13:53:59', '-1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '10', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-21 13:53:58','0','0','',''); -- id=32
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where 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 ('10','00004', '30', '3', '4', '1', '10', '10', '0', '', '0', '2025-12-21 13:53:59', '4', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','3-1,','1','1','0','0','10','10','0','','0','0.00','0','0','0','0'); -- id=35
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 = 35;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4, '2025-12-21', 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-21', 10, 10, 10
                    , 10, 10, 10, 10
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 10, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10, sellCostBuyPrice =sellCostBuyPrice+10
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '11', userid = '-1', storedetaildate = '2025-12-21 13:53:59' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '1', '1', '30', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '11', '-1', '2025-12-21 13:53:59','0','0'); -- id=62
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1280',  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 ('1270','10', '0', '1', 'اضافة فاتورة مبيعات', '30', '1280', '2025-12-21 13:53:59', '-1',  'sellbillController.php','1','','0'); -- id=27
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10', '10', '2025-12-21', '-1', '0', '0', '2025-12-21 13:53:59','اضافة فاتورة مبيعات رقم 30','1','0',null,'0','30','sellbillController.php?do=showDetail&sellbillid=30'); -- id=53
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('53', '383', '10', '','0'); -- id=53
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '1270', 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 ('53', '143', '10', '','0'); -- id=53
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '800', 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-21', '-1', '0', '0', '2025-12-21 13:53:59','اضافة فاتورة مبيعات رقم 30 - صرف البضاعة من المخزن','1','0',null,'0','30','sellbillController.php?do=showDetail&sellbillid=30'); -- id=54
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('54', '402', '10', '','0'); -- id=54
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '-139', theOrder = '0', layingOrder = '510104', 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 ('54', '382', '10', '','0'); -- id=54
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '10139', 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='53,0,54' where sellbillid=30;
 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-21', 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-21', 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 06947dfcbb4e8a and sellbillId = 30 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:23:59";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:53:59", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:24:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:54:11", deviceType = "DESKTOP" WHERE userid = -1;

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06947dfd7151e2
-- ----------------------------------------------------------------------------------------------------

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-21 13:54:11', '06947dfd7151e2', '1', '0.00', '0', '0', '1', '10.00', '10', '10', '0', '1', '2025-12-21 13:54:11', '', '-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-21','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=31
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','اضافة فاتورة مبيعات','31', '0', '2025-12-21 13:54:11', '-1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '10', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-21 13:54:11','0','0','',''); -- id=33
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where 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 ('10','00004', '31', '3', '4', '1', '10', '10', '0', '', '0', '2025-12-21 13:54:11', '4', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','3-1,','1','1','0','0','10','10','0','','0','0.00','0','0','0','0'); -- id=36
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 = 36;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4, '2025-12-21', 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-21', 10, 10, 10
                    , 10, 10, 10, 10
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 10, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10, sellCostBuyPrice =sellCostBuyPrice+10
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '-1', storedetaildate = '2025-12-21 13:54:11' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '1', '1', '31', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11', '10', '-1', '2025-12-21 13:54:11','0','0'); -- id=63
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1290',  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 ('1280','10', '0', '1', 'اضافة فاتورة مبيعات', '31', '1290', '2025-12-21 13:54:11', '-1',  'sellbillController.php','1','','0'); -- id=28
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10', '10', '2025-12-21', '-1', '0', '0', '2025-12-21 13:54:11','اضافة فاتورة مبيعات رقم 31','1','0',null,'0','31','sellbillController.php?do=showDetail&sellbillid=31'); -- id=55
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('55', '383', '10', '','0'); -- id=55
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '1280', 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 ('55', '143', '10', '','0'); -- id=55
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '810', 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-21', '-1', '0', '0', '2025-12-21 13:54:11','اضافة فاتورة مبيعات رقم 31 - صرف البضاعة من المخزن','1','0',null,'0','31','sellbillController.php?do=showDetail&sellbillid=31'); -- id=56
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('56', '402', '10', '','0'); -- id=56
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '-129', theOrder = '0', layingOrder = '510104', 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 ('56', '382', '10', '','0'); -- id=56
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '10129', 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='55,0,56' where sellbillid=31;
 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-21', 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-21', 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 06947dfd7151e2 and sellbillId = 31 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:24:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:54:11", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:24:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:54:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:24:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:54:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:24:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:54:46", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:24:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:54:48", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:24:59";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:54:59", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:25:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:55:11", deviceType = "DESKTOP" WHERE userid = -1;
BEGIN;
INSERT INTO returnbuybill (returnbuybillSerial, returnbuybilldate, returnbuybillsupplierid, returnbuybilltotaldeptbefor, returnbuybilltotaldeptafter, returnbuybilldiscount, returnbuybilldiscountrype, returnbuybilltotalbill, returnbuybillaftertotalbill, returnbuybilltotalpayed, returnbuybillfinalbill, returnbuybillstoreid, returnbuybillsysdate,comment, userid, conditions, returnbuybillclientname, returnbuybillsaveid, billnameid, returnbuybilldirectpayment,payedtax,costcenterid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,client,returnbuybilladdition,returnbuybilladditiontrype) VALUES ('06947e01409759', '2025-12-21 13:55:00', '1', '2689.00', '2639', '0', '0', '-50.00', '-50', '0', '-50', '1', '2025-12-21 13:55:11', '', '-1', '0', '', '1', '6','1','0','-1','0','1','0','0','0','0','0'); -- id=1
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00004', '1', '3', '4', '5', '10', '50', '0', '', '4','','','0','0','0','0','0','10','50','0','0','0','0','0','0','0','1'); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:26:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:56:19", deviceType = "DESKTOP" WHERE userid = -1;
BEGIN;
INSERT INTO returnbuybill (returnbuybillSerial, returnbuybilldate, returnbuybillsupplierid, returnbuybilltotaldeptbefor, returnbuybilltotaldeptafter, returnbuybilldiscount, returnbuybilldiscountrype, returnbuybilltotalbill, returnbuybillaftertotalbill, returnbuybilltotalpayed, returnbuybillfinalbill, returnbuybillstoreid, returnbuybillsysdate,comment, userid, conditions, returnbuybillclientname, returnbuybillsaveid, billnameid, returnbuybilldirectpayment,payedtax,costcenterid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,client,returnbuybilladdition,returnbuybilladditiontrype) VALUES ('06947e01409759', '2025-12-21 13:55:00', '1', '2689.00', '2639', '0', '0', '-50.00', '-50', '0', '-50', '1', '2025-12-21 13:56:19', '', '-1', '0', '', '1', '6','1','0','-1','0','1','0','0','0','0','0'); -- id=2
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00004', '2', '3', '4', '5', '10', '50', '0', '', '4','','','0','0','0','0','0','10','50','0','0','0','0','0','0','0','1'); -- id=2
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:26:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:56:29", deviceType = "DESKTOP" WHERE userid = -1;
BEGIN;
INSERT INTO returnbuybill (returnbuybillSerial, returnbuybilldate, returnbuybillsupplierid, returnbuybilltotaldeptbefor, returnbuybilltotaldeptafter, returnbuybilldiscount, returnbuybilldiscountrype, returnbuybilltotalbill, returnbuybillaftertotalbill, returnbuybilltotalpayed, returnbuybillfinalbill, returnbuybillstoreid, returnbuybillsysdate,comment, userid, conditions, returnbuybillclientname, returnbuybillsaveid, billnameid, returnbuybilldirectpayment,payedtax,costcenterid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,client,returnbuybilladdition,returnbuybilladditiontrype) VALUES ('06947e01409759', '2025-12-21 13:55:00', '1', '2689.00', '2639', '0', '0', '-50.00', '-50', '0', '-50', '1', '2025-12-21 13:56:29', '', '-1', '0', '', '1', '6','1','0','-1','0','1','0','0','0','0','0'); -- id=3
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00004', '3', '3', '4', '5', '10', '50', '0', '', '4','','','0','0','0','0','0','10','50','0','0','0','0','0','0','0','1'); -- id=3
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:29:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:59:03", deviceType = "DESKTOP" WHERE userid = -1;
BEGIN;
INSERT INTO returnbuybill (returnbuybillSerial, returnbuybilldate, returnbuybillsupplierid, returnbuybilltotaldeptbefor, returnbuybilltotaldeptafter, returnbuybilldiscount, returnbuybilldiscountrype, returnbuybilltotalbill, returnbuybillaftertotalbill, returnbuybilltotalpayed, returnbuybillfinalbill, returnbuybillstoreid, returnbuybillsysdate,comment, userid, conditions, returnbuybillclientname, returnbuybillsaveid, billnameid, returnbuybilldirectpayment,payedtax,costcenterid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,client,returnbuybilladdition,returnbuybilladditiontrype) VALUES ('06947e01409759', '2025-12-21 13:55:00', '1', '2689.00', '2639', '0', '0', '-50.00', '-50', '0', '-50', '1', '2025-12-21 13:59:03', '', '-1', '0', '', '1', '6','1','0','-1','0','1','0','0','0','0','0'); -- id=4
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00004', '4', '3', '4', '5', '10', '50', '0', '', '4','','','0','0','0','0','0','10','50','0','0','0','0','0','0','0','1'); -- id=4
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:29:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:59:18", deviceType = "DESKTOP" WHERE userid = -1;
BEGIN;
INSERT INTO returnbuybill (returnbuybillSerial, returnbuybilldate, returnbuybillsupplierid, returnbuybilltotaldeptbefor, returnbuybilltotaldeptafter, returnbuybilldiscount, returnbuybilldiscountrype, returnbuybilltotalbill, returnbuybillaftertotalbill, returnbuybilltotalpayed, returnbuybillfinalbill, returnbuybillstoreid, returnbuybillsysdate,comment, userid, conditions, returnbuybillclientname, returnbuybillsaveid, billnameid, returnbuybilldirectpayment,payedtax,costcenterid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,client,returnbuybilladdition,returnbuybilladditiontrype) VALUES ('06947e01409759', '2025-12-21 13:55:00', '1', '2689.00', '2639', '0', '0', '-50.00', '-50', '0', '-50', '1', '2025-12-21 13:59:18', '', '-1', '0', '', '1', '6','1','0','-1','0','1','0','0','0','0','0'); -- id=5
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00004', '5', '3', '4', '5', '10', '50', '0', '', '4','','','0','0','0','0','0','10','50','0','0','0','0','0','0','0','1'); -- id=5
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.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 = '4';
UPDATE returnbuybilldetail SET  lastbuyprice = 10 , meanbuyprice = 10, lastbuyprice_withDiscount = 10, meanbuyprice_withDiscount = 10
        , lastbuyprice_withTax = 10, meanbuyprice_withTax = 10, lastbuyprice_withDiscountAndTax = 10
                where returnbuybilldetailid = 5;
UPDATE productunit SET proUnitBuyPrice  = 10 * productnumber WHERE productid = 4;
UPDATE storedetail SET  productquantity = '5', userid = '-1', storedetaildate = '2025-12-21' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '5', '1', '5', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '10', '5', '-1', '2025-12-21 13:55:00','0','0'); -- id=64
UPDATE supplier SET  suppliercurrentDebt = '2639',suppliercurrentDebtInCurrency= '2639' , userid = '-1', supplierdate = '2025-12-21 13:59:18'   WHERE supplierid = '1';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('1', '2689.00', '50', '1', 'اضافة فاتورة مردوات مشتريات', '5', '2639', '2025-12-21 13:55:00', '-1', 'returnBuyBillController.php', 'اضافة فاتورة مردوات مشتريات', '0','', '0','1','1','50','1','2689','50','2639','0',''); -- id=23
update returnbuybill set dailyentryid='0,0' where returnbuybillid=5;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:29:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:59:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:29:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:59:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:29:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:59:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:29:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:59:34", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:29:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:59:42", deviceType = "DESKTOP" WHERE userid = -1;

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06947e126d24b4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno,returnsellbilltypeclientid) VALUES ('2025-12-21 13:59:42', '06947e126d24b4', '1', '0.00', '0', '0', '1', '40', '40', '-40', '0', '1', '2025-12-21 13:59:42', '', '-1', '0', 'نقدي','1', '0', '5', '0', 'نقدي', '4', '0', '', '','','','-1','0','0','0','','0','-40','0','0','0','0','0','0','0','0','-1','0','0','1','','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','1','اضافة فاتورة مردوات مبيعات','1', '0', '2025-12-21 13:59:42', '-1', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '40', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-21 13:59:42','0','0','',''); -- id=34
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('10.00', '00004', '1', '3', '4', '4', '10', '40', '0', '', '0', '0', '4', '0.00', '-1','1','0','','','0','0','0','0','0','0','1','1','','0','0','10','40','0','','0'); -- id=1
UPDATE returnsellbilldetail 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 returnsellbilldetailid = 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 (4, '2025-12-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 40, 40, 40, 40
                    , 40, 40, 40, 0, 4, 0, 0, 40, 40)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+40, returnSellCostBuyPrice = returnSellCostBuyPrice+40, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+40
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+40, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+40
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+40
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+40
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+40
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+40
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+4;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2025-12-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 40, 40, 40, 40
                    , 40, 40, 40, 0, 0, 40, 40)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+40, returnSellCostBuyPrice = returnSellCostBuyPrice+40, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+40
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+40, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+40
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+40
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+40
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+40
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+40;
UPDATE storedetail SET  productquantity = '9', userid = '-1', storedetaildate = '2025-12-21 13:59:42' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '4', '0', '1', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '5', '9', '-1', '2025-12-21 13:59:42','0','0'); -- id=65
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1250',  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 ('1290','-40', '1', '1', 'اضافة فاتورة مردوات مبيعات', '1', '1250', '2025-12-21 13:59:42', '-1',  'returnsellbillController.php','1','','0'); -- id=29
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '40', '40', '2025-12-21', '-1', '0', '0', '2025-12-21 13:59:42','اضافة فاتورة مردود مبيعات رقم 1','1','0',null,'0','1','returnsellbillController.php?do=showDetail&returnsellbillid=1'); -- id=57
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('57', '143', '40', '','0'); -- id=57
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '770', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('57', '383', '40', '','0'); -- id=57
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '1240', 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 dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '40', '40', '2025-12-21', '-1', '0', '0', '2025-12-21 13:59:42','اضافة فاتورة مردود مبيعات رقم 1 - صرف البضاعة من المخزن','1','0',null,'0','1','returnsellbillController.php?do=showDetail&returnsellbillid=1'); -- id=58
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('58', '382', '40', '','0'); -- id=58
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '10169', 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 ('58', '402', '40', '','0'); -- id=58
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '-169', theOrder = '0', layingOrder = '510104', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
update returnsellbill set dailyentryid='57,0,58' where returnsellbillid=1;
 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-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 40, 40, 40, 40
                    , 40, 40, 40 ,0, 0, 40, 40)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+40, returnSellCostBuyPrice = returnSellCostBuyPrice+40, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+40
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+40, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+40
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+40
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+40
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+40
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+40;
 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-21', 0, 0, 0
                    , 0, 0, 0, 0
                    , 40, 40, 40, 40
                    , 40, 40, 40 ,0, 0, 40, 40)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+40, returnSellCostBuyPrice = returnSellCostBuyPrice+40, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+40
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+40, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+40
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+40
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+40
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+40
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+40;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -40, -40, -40
                    , -40, -40, -40, -40, -40, -40)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-40, netSellCostBuyPrice = netSellCostBuyPrice+-40
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-40
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-40
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-40
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-40
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-40
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-40
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-40;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06947e126d24b4 and sellbillId = 1 and returnsellbillId = 1
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:29:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:59:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:29:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:59:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:29:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:59:49", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:29:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 13:59:55", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:30:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:00:03", deviceType = "DESKTOP" WHERE userid = -1;
BEGIN;
INSERT INTO returnbuybill (returnbuybillSerial, returnbuybilldate, returnbuybillsupplierid, returnbuybilltotaldeptbefor, returnbuybilltotaldeptafter, returnbuybilldiscount, returnbuybilldiscountrype, returnbuybilltotalbill, returnbuybillaftertotalbill, returnbuybilltotalpayed, returnbuybillfinalbill, returnbuybillstoreid, returnbuybillsysdate,comment, userid, conditions, returnbuybillclientname, returnbuybillsaveid, billnameid, returnbuybilldirectpayment,payedtax,costcenterid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,client,returnbuybilladdition,returnbuybilladditiontrype) VALUES ('06947e13b151f9', '2025-12-21 13:59:55', '1', '2639.00', '2629', '0', '0', '-10.00', '-10', '0', '-10', '1', '2025-12-21 14:00:03', '', '-1', '0', '', '1', '6','1','0','-1','0','1','0','0','0','0','0'); -- id=6
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00004', '6', '3', '4', '1', '10', '10', '0', '', '4','','','0','0','0','0','0','10','10','0','0','0','0','0','0','0','1'); -- id=6
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.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 = '4';
UPDATE returnbuybilldetail SET  lastbuyprice = 10 , meanbuyprice = 10, lastbuyprice_withDiscount = 10, meanbuyprice_withDiscount = 10
        , lastbuyprice_withTax = 10, meanbuyprice_withTax = 10, lastbuyprice_withDiscountAndTax = 10
                where returnbuybilldetailid = 6;
UPDATE productunit SET proUnitBuyPrice  = 10 * productnumber WHERE productid = 4;
UPDATE storedetail SET  productquantity = '8', userid = '-1', storedetaildate = '2025-12-21' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '1', '1', '6', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '9', '8', '-1', '2025-12-21 13:59:55','0','0'); -- id=66
UPDATE supplier SET  suppliercurrentDebt = '2629',suppliercurrentDebtInCurrency= '2629' , userid = '-1', supplierdate = '2025-12-21 14:00:03'   WHERE supplierid = '1';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('1', '2639.00', '10', '1', 'اضافة فاتورة مردوات مشتريات', '6', '2629', '2025-12-21 13:59:55', '-1', 'returnBuyBillController.php', 'اضافة فاتورة مردوات مشتريات', '0','', '0','1','1','10','1','2639','10','2629','0',''); -- id=24
update returnbuybill set dailyentryid='0,0' where returnbuybillid=6;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:30:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:00:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:30:32";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:00:32", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:30:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:00:46", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:31:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:01:49", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:32:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:02:12", deviceType = "DESKTOP" WHERE userid = -1;
INSERT INTO expensestype (expensestypename, expensestypedetails, expensestypedate, conditions, userid, parent,type,saveid,addOnlyGroupIds,treeType,treeId,withinsupervision_ratio,supervision_ratiotype,supervision_amount,webApiId) VALUES ('hire', '0', '2025-12-21', '0', '-1', '0' ,'0','1','1,2,3,4','0','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 ('hire', 'hire', 'hire', 'hire', '414', '0', '0', '0', '', '2', '2', '', '0', '3', '0', '', '-1', '0', '2025-12-21 14:02:12'); -- id=420
UPDATE expensestype SET expensestypename = 'hire', expensestypedetails = '0', expensestypedate = '2025-12-21', conditions = '0', userid = '-1', parent = '0', type= '0', saveid='1', addOnlyGroupIds='1,2,3,4',treeType='0',treeId='420',withinsupervision_ratio='1',supervision_ratiotype='0',supervision_amount='' WHERE expensestypeid = '1';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:32:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:02:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:32:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:02:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:32:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:02:46", deviceType = "DESKTOP" WHERE userid = -1;
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId,tagids,chasis) VALUES ('1', 'new hire', '', '500', '2025-12-21', '-1', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0','','اختر الشاسيه'); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:43:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:13:07", deviceType = "DESKTOP" WHERE userid = -1;
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid,expensenumbrt,expenseprice,expensetotaln,expenseshortfalls,supplier,suppRemainingVal,sellbillid,clientid,realestateid,realestateunitid,file,taxPer,taxVal,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,travelOfficeId,webApiId,tagids,chasis) VALUES ('1', 'new hire', '', '500', '2025-12-21', '-1', '0','-1','1','0','0','0','','0','0','0','0','0','0','0','0','0','0','0','.','0','0','0','0','0','0','0','0','0','0','','اختر الشاسيه'); -- id=2
UPDATE save SET  savecurrentvalue = '750',  userid = '-1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('1250.00','500', '1', '1', 'إضافة مصروف', '2', '750', '2025-12-21 14:13:07', '-1',  'expensesController.php','0','','0'); -- id=30
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '500', '500', '2025-12-21', '-1', '0', '0', '2025-12-21 14:13:07','اضافة اسم مصروف( new hire )','1','0','0','0','2','expensesController.php?do=show&id=2'); -- id=59
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('59', '420', '500', '','0'); -- id=59
UPDATE accountstree SET name = 'hire', customName = 'hire', customNameEn = 'hire', nameEn = 'hire', parent = '414', accountNature = '0', theValue = '500', theOrder = '0', layingOrder = '', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2025-12-21 14:02:12' WHERE id = '420';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('59', '383', '500', '','0'); -- id=59
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '740', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE expenses SET expensestypeid = '1', expensesname = 'new hire', expensesdetails = '', expensesValue = '500.00', expensesdate = '2025-12-21', userid = '-1', conditions = '0',saveid = '1' , dailyentryid = '59', bankid = '0', bankaccountid = '0', checknum = '', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0',tagids='',chasis='اختر الشاسيه' WHERE expensesid = '2';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:43:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:13:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:43:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:13:25", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:43:41";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:13:41", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:44:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:14:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:44:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:14:05", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:56:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:26:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:56:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:26:11", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:56:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:26:17", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:56:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:26:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:56:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:26:24", deviceType = "DESKTOP" WHERE userid = -1;
BEGIN;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:56:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:26:51", deviceType = "DESKTOP" WHERE userid = -1;
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 6) and  modelid = 2;
UPDATE save SET  savecurrentvalue = '1250',  userid = '-1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('750.00','500.00', '0', '1', 'حذف مصروف', '2', '1250', '2025-12-21 14:26:51', '-1',  'expensesController.php','0','','0'); -- id=31
UPDATE costcenterdetail SET del = 0 WHERE type in( 6) and  modelid = 2;
UPDATE save SET  savecurrentvalue = '650',  userid = '-1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('1250.00','600.00', '1', '1', 'إضافة مصروف', '2', '650', '2025-12-21 14:26:51', '-1',  'expensesController.php','0','','0'); -- id=32
UPDATE dailyentry SET totalcreditor = '500.00', totaldebtor = '500.00', thedate = '2025-12-21', userid = '-1', `condition` = '0', reverseofid = '-10', dDateTime = '2025-12-21 14:13:07', entryComment = 'اضافة اسم مصروف( new hire )', fromFlag = '1',related='0',isopeningentry='0',operationId='2',operationDetailLink='expensesController.php?do=show&id=2' WHERE id = '59';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '500.00', '500.00', '2025-12-21', '-1', '0', '59', '2025-12-21 14:26:51','تم عكس القيد رقم 59 ','1','0','0','0','0',''); -- id=60
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('60', '420', '500.00', '','0'); -- id=60
UPDATE accountstree SET name = 'hire', customName = 'hire', customNameEn = 'hire', nameEn = 'hire', parent = '414', accountNature = '0', theValue = '0', theOrder = '0', layingOrder = '', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2025-12-21 14:02:12' WHERE id = '420';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('60', '383', '500.00', '','0'); -- id=60
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '1240', 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 dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '600', '600', '2025-12-21', '-1', '0', '0', '2025-12-21 14:26:51','تم تعديل المصروف','1','0','0','0','0','expensesController.php?do=show&id='); -- id=61
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('61', '420', '600.00', '','0'); -- id=61
UPDATE accountstree SET name = 'hire', customName = 'hire', customNameEn = 'hire', nameEn = 'hire', parent = '414', accountNature = '0', theValue = '600', theOrder = '0', layingOrder = '', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2025-12-21 14:02:12' WHERE id = '420';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('61', '383', '600', '','0'); -- id=61
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '640', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE expenses SET expensestypeid = '1', expensesname = 'new hire', expensesdetails = '', expensesValue = '600.00', expensesdate = '2025-12-21', userid = '-1', conditions = null,saveid = '1' , dailyentryid = '61', bankid = '0', bankaccountid = '0', checknum = '0', productid = '0', expensenumbrt = '0', expenseprice = '0', expensetotaln = '0', expenseshortfalls = '0',supplier='0',suppRemainingVal='0',sellbillid='0',clientid='0',realestateid='0',realestateunitid='0',file='.',taxPer='0',taxVal='0',travelDriverId='0',travelBusId='0',travelPathId='0',travelTripId='0',travelTripTypeId='0',travelTripDateId='0',travelOfficeId='0',webApiId='0',tagids='',chasis='اختر الشاسيه' WHERE expensesid = '2';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:56:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:26:58", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:57:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:27:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:57:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:27:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:57:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:27:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:58:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:28:00", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:58:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:28:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:58:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:28:15", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:58:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:28:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE productunit SET proUnitBuyPrice  = 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-21 14:28:34',-1)
                ON DUPLICATE KEY UPDATE productid = 1, edited = 1, sysdate = '2025-12-21 14:28:34', userid = -1; -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 10:59:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:29:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:00:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:30:16", deviceType = "DESKTOP" WHERE userid = -1;
INSERT INTO productionrate (name, finalName, userId, thedate, conditions,sizeid,colorid) VALUES ('fff', '3', '-1', '2025-12-21', '0','0','0'); -- id=1
INSERT INTO productionrateproduct (productionRateId, productId, unitId, rate, quantity, userId, thedate, conditions,sizeid,colorid) VALUES ('1', '4', '4', '100', '0', '-1', '2025-12-21', '0','0','0'); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:00:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:30:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:00:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:30:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:01:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:31:18", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:01:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:31:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE productunit SET proUnitBuyPrice  = 20.00 * productnumber WHERE productid = 2;
UPDATE product SET productName = 'prod2', productDescription = '', productCatId = '1', productBuyPrice = '20.00', productSellAllPrice = '20.00', productSellUnitPrice = '20.00', productSellHalfPrice = '20.00', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00002',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '20.00',lastbuyprice_withDiscount = '20',meanbuyprice = '20.00',meanbuyprice_withDiscount = '20' , productbuypricereal = '20.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='20',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='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 onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2, 1,'2025-12-21 14:31:32',-1)
                ON DUPLICATE KEY UPDATE productid = 2, edited = 1, sysdate = '2025-12-21 14:31:32', userid = -1; -- id=8
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:01:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:31:43", deviceType = "MOBILE" WHERE userid = -1;
UPDATE productunit SET proUnitBuyPrice  = 20.00 * productnumber WHERE productid = 2;
UPDATE product SET productName = 'prod2', productDescription = '', productCatId = '1', productBuyPrice = '20.00', productSellAllPrice = '20.00', productSellUnitPrice = '20.00', productSellHalfPrice = '20.00', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00002',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '20.00',lastbuyprice_withDiscount = '20',meanbuyprice = '20.00',meanbuyprice_withDiscount = '20' , productbuypricereal = '20.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='20',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='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 onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2, 1,'2025-12-21 14:31:52',-1)
                ON DUPLICATE KEY UPDATE productid = 2, edited = 1, sysdate = '2025-12-21 14:31:52', userid = -1; -- id=8
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:02:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:32:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:02:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:32:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:02:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:32:34", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:02:41";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:32:41", deviceType = "DESKTOP" WHERE userid = -1;
INSERT INTO supplier (suppliername, supplieraddress, supplierphone, suppliercurrentDebt, supplierdetails, conditions, userid, supplierdate, dailyentryid, category_id, typesupplier_id,linkedClientId,inUse,suppliercode,goverareaid,namepayeecheck,suppliermobile,warrantyOfficer,warrantymobile,sellername,sellermobile,taxnumber,supplierTypeForTree,treeId,sullpierCurrencyid,suppliercurrentDebtInCurrency,webApiId,shippingDiscountPer) VALUES ('new supplier', '', '', '0', '', '0', '-1', '2025-12-21 14:32:41', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=2
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('2', '0', '0', '0', 'إضافة مورد جديد', '2', '0', '2025-12-21 14:32:41', '-1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=25
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('new supplier', 'new supplier', 'new supplier', 'new supplier', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '-1', '0', '2025-12-21 14:32:41'); -- id=421
UPDATE supplier SET suppliername = 'new supplier', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '-1', supplierdate = '2025-12-21', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='421',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '2';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:02:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:32:56", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:03:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:33:00", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE productunit SET proUnitBuyPrice  = 20.00 * productnumber WHERE productid = 2;
UPDATE product SET productName = 'prod2', productDescription = '', productCatId = '1', productBuyPrice = '20.00', productSellAllPrice = '20.00', productSellUnitPrice = '20.00', productSellHalfPrice = '20.00', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00002',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '20.00',lastbuyprice_withDiscount = '20',meanbuyprice = '20.00',meanbuyprice_withDiscount = '20' , productbuypricereal = '20.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='20',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='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 onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2, 1,'2025-12-21 14:33:13',-1)
                ON DUPLICATE KEY UPDATE productid = 2, edited = 1, sysdate = '2025-12-21 14:33:13', userid = -1; -- id=8
UPDATE productunit SET proUnitBuyPrice  = 20.00 * productnumber WHERE productid = 2;
UPDATE product SET productName = 'prod2', productDescription = '', productCatId = '1', productBuyPrice = '20.00', productSellAllPrice = '20.00', productSellUnitPrice = '20.00', productSellHalfPrice = '20.00', productDate = '2025-12-09', conditions = '0', userId = '1', limitamount = '0', parcode = '00002',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '20.00',lastbuyprice_withDiscount = '20',meanbuyprice = '20.00',meanbuyprice_withDiscount = '20' , productbuypricereal = '20.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='20',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='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 onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2, 1,'2025-12-21 14:36:25',-1)
                ON DUPLICATE KEY UPDATE productid = 2, edited = 1, sysdate = '2025-12-21 14:36:25', userid = -1; -- id=8
UPDATE productunit SET proUnitBuyPrice  = 12.00 * productnumber WHERE productid = 1;
UPDATE product SET productName = 'prod1', productDescription = '', productCatId = '1', productBuyPrice = '12.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 = '11',meanbuyprice_withDiscount = '11' , 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='11',meanbuyprice_withTax='11',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-21 14:36:29',-1)
                ON DUPLICATE KEY UPDATE productid = 1, edited = 1, sysdate = '2025-12-21 14:36:29', userid = -1; -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:06:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:36:34", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:06:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:36:36", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:06:41";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:36:41", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:06:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:36:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:06:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:36:43", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:06:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:36:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:06:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:36:45", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:06:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:36:46", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:06:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:36:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:06:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:36:48", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:06:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:36:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:06:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:36:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:06:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:36:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:07:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:37:00", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:07:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:37:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:07:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:37:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:08:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:38:00", deviceType = "DESKTOP" WHERE userid = -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', '63', '0', '0', '0', '', '1', '1', '', '0', '1', '1', '', '-1', '0', '2025-12-21 14:38:00'); -- id=422
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', '97', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '-1', '0', '2025-12-21 14:38:00'); -- id=423
INSERT INTO employee (employeeName, employeeBOD, employeeAddress, employeePhone, employeeSalary, employeeBouns, employeeDate, conditions, userId, username, isworker, Hourlyrate, houseAllowance, transportationAllowance, otherAllowance, nationality, religion, noOfWorkDaysPerMonth, noOfWorkHoursDaysPerDay, noOfDistountDaysWhenAbsences, contract, residence, personalPhoto, healthCard, visa, passport, minuteLateCost, dayAbsencesCost, graduate, expert1, expert2, expert3, employeegroupid, employeesubgroupid, halfHourLateWithPermissionDisount, hourLateWithPermissionDisount, hourAndHalfLateWithPermissionDisount, twoHoursLateWithPermissionDisount, halfHourLateWithoutPermissionDisount, hourLateWithoutPermissionDisount, hourAndHalfLateWithoutPermissionDisount, twoHoursLateWithoutPermissionDisount, halfHourPermissionDisount, hourPermissionDisount, hourAndHalfPermissionDisount, twoHoursPermissionDisount, dayAbsenceWithPermissionDisount, dayAbsenceWithoutPermissionDisount,moreThanTwoHoursLateWithPermissionDisount,moreThanTwoHoursLateWithoutPermissionDisount,empFingerId,empRFID,empFingerId2,empFingerId3,empFingerId4,empFingerId5,numberOfMinutesOfDelayAllowed,takeVacationDays,treeId,treeId2,quarterHourLateWithPermissionDisount,quarterHourLateWithoutPermissionDisount, numberOfCountsOfDelayAllowed,branchid,empCode,socialInsurance,workTax,sysdate,birthCertificate,armyPhoto,idCard,driverLicense,endorsementPeace,confidentialityDeclaration,criminalCamouflage,practiceProfession,socialStatus,administration,worthExtra,subManagement,directManager,occupation,dateBeing,gender,socialSituation,bankAccount,dcholarship,extradayval) VALUES ('hazem', '', '', '', '0', '', '2025-12-21 02:38:00 PM', '0', '-1', 'GT4', '1', '0', '0', '0', '', '0', '0', '0', '0', '0', '.', '.', '.', '.', '.', '.', '', '', '.', '.', '.', '.', '-1', '0', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1','1','1','','','','','','','1','1','422','423','1','0','1','-1','5432','0','0','2025-12-21 02:38:00 PM','.','.','.','.','.','.','.','.','.','','','','','','','0','','','','0'); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:08:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:38:03", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:08:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:38:07", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:08:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:38:09", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE employee SET employeeName = 'hazem', employeeBOD = '0000-00-00', employeeAddress = '', employeePhone = '', employeeSalary = '0.00', employeeBouns = '', employeeDate = '2025-12-21 02:38:00', conditions = '0', userId = '-1', username = 'GT4', isworker = '1', Hourlyrate = '0.00', houseAllowance = '0.00', transportationAllowance = '0.00', otherAllowance = '0.00', nationality = '0', religion = '0', noOfWorkDaysPerMonth = '0', noOfWorkHoursDaysPerDay = '0', noOfDistountDaysWhenAbsences = '0', contract = '.', residence = '.', personalPhoto = '.', healthCard = '.', visa = '.', passport = '.', minuteLateCost = '0.00', dayAbsencesCost = '0.00', graduate = '.', expert1 = '.', expert2 = '.', expert3 = '.', employeegroupid = '0', employeesubgroupid = '0', halfHourLateWithPermissionDisount = '1', hourLateWithPermissionDisount = '1', hourAndHalfLateWithPermissionDisount = '1', twoHoursLateWithPermissionDisount = '1', halfHourLateWithoutPermissionDisount = '1', hourLateWithoutPermissionDisount = '1', hourAndHalfLateWithoutPermissionDisount = '1', twoHoursLateWithoutPermissionDisount = '1', halfHourPermissionDisount = '1', hourPermissionDisount = '1', hourAndHalfPermissionDisount = '1', twoHoursPermissionDisount = '1', dayAbsenceWithPermissionDisount = '1', dayAbsenceWithoutPermissionDisount = '1',moreThanTwoHoursLateWithPermissionDisount = '1',moreThanTwoHoursLateWithoutPermissionDisount = '1',empFingerId = '',empRFID = '',empFingerId2 = '',empFingerId3 ='',empFingerId4 = '',empFingerId5 = '',numberOfMinutesOfDelayAllowed = '1',takeVacationDays = '1',quarterHourLateWithPermissionDisount = '1',quarterHourLateWithoutPermissionDisount = '0', numberOfCountsOfDelayAllowed = '1', branchid = '-1', empCode = '5432',socialInsurance='0',workTax='0',sysdate='2025-12-21 14:38:09',birthCertificate='.', armyPhoto='.', idCard='.', driverLicense='.', endorsementPeace='.', confidentialityDeclaration='.', criminalCamouflage='.', practiceProfession='.', socialStatus='.', administration='', worthExtra='', subManagement='', directManager='', occupation='', dateBeing='', gender='0', socialSituation='', bankAccount='', dcholarship='', extradayval='0.00' WHERE employeeId = '1';
UPDATE accountstree SET name = 'hazem', customName = 'hazem', customNameEn = 'سلفة hazem', nameEn = 'سلفة hazem', parent = '63', accountNature = '0', theValue = '0.00', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '-1', del = '0', sysdate = '2025-12-21 14:38:09' WHERE id = '422';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:10:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:40:00", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:10:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:40:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:10:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:40:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:10:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:40:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:10:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:40:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:10:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:40:55", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:10:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:40:58", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:11:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:41:05", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:11:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:41:09", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:11:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:41:16", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE sellbill SET  shippingDate = "2025-12-10" WHERE sellbillid = 27;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:15:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:45:20", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:15:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:45:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:15:32";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:45:32", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:15:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:45:35", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:15:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:45:47", deviceType = "DESKTOP" WHERE userid = -1;
INSERT INTO employeepersonnel (employeeid, employeepersonnelvalue, employeepersonnelnote, conditions, userid, employeepersonneldate, employeepersonneltype,empdeptbefor,empdeptafter,paymenttype,payid,payid2,checknum,isMandobReward,dailyentryid,deviceid,employeedeviceid) VALUES ('1', '100', ' ', '0', '-1', '2025-12-21 14:45:35', '2','0','0','0','1','0','','0','0','','1'); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:17:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:47:12", deviceType = "DESKTOP" WHERE userid = -1;
INSERT INTO employeepersonnel (employeeid, employeepersonnelvalue, employeepersonnelnote, conditions, userid, employeepersonneldate, employeepersonneltype,empdeptbefor,empdeptafter,paymenttype,payid,payid2,checknum,isMandobReward,dailyentryid,deviceid,employeedeviceid) VALUES ('1', '100', ' ', '0', '-1', '2025-12-21 14:45:35', '2','0','0','0','1','0','','0','0','','1'); -- id=2
UPDATE employeepersonnel SET employeeid = '1', employeepersonnelvalue = '100.00', employeepersonnelnote = ' ', conditions = '0', userid = '-1', employeepersonneldate = '2025-12-21 14:45:35', employeepersonneltype = '2',paymenttype = '0',payid = '1',payid2 = '0',checknum = '',isMandobReward='0',dailyentryid='0',deviceid='',employeedeviceid='1' WHERE employeepersonnelid = '2';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:17:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:47:20", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:17:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:47:38", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:17:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:47:46", deviceType = "DESKTOP" WHERE userid = -1;
INSERT IGNORE INTO employeeclosedayhistory (employeeid, day, attendanceTime, departureTime, latePeriod, lateHasPermission, lateDiscount, isAbsent, absentHasPermission, absentDiscount, userid, sysdate, del, status)
                SELECT employeeId , "2025-12-21", "00:00:00" , "00:00:00" ,0 ,0 ,0 ,1 ,0 ,dayAbsenceWithoutPermissionDisount , -1, "2025-12-21 14:48:31",0,-1
                from employee where conditions = 0 ; -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:18:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:48:37", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:19:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:49:08", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:19:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:49:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:19:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:49:20", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:19:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:49:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:19:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:49:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:19:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:49:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:19:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:49:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:19:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:49:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:19:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:49:42", deviceType = "DESKTOP" WHERE userid = -1;
INSERT INTO restauranthall (name,hallPrice, hallUsers, userId, sysdate, del) VALUES ('s1', '0', '-1,1', '-1', '2025-12-21','0'); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:19:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:49:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:19:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:49:55", deviceType = "DESKTOP" WHERE userid = -1;
INSERT INTO restauranttable (id, hallid, name, beingUsed, userId, sysdate, del) VALUES ('-1', '-1', 'تيك أواى', '0', '-1', '2025-12-21', '0'); -- id=18446744073709551615
INSERT INTO restauranttable (id, hallid, name, beingUsed, userId, sysdate, del) VALUES ('-2', '-2', 'دليفرى', '0', '-1', '2025-12-21', '0'); -- id=18446744073709551614
INSERT INTO restauranttable (hallid, name, beingUsed, userId, sysdate, del) VALUES ('1', 't1', '0', '-1', '2025-12-21', '0'); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:20:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:50:08", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:20:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:50:13", deviceType = "DESKTOP" WHERE userid = -1;
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-21',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 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-21',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
                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-21 11:20:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:50:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:20:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:50:26", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:20:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:50:37", deviceType = "DESKTOP" WHERE userid = -1;
INSERT INTO restaurantprinter (name, cats, userid, sysdate, del) VALUES ('p1', '1,2,3', '-1', '2025-12-21', '0'); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:20:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:50:45", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:21:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:51:00", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE resturantcategory SET category_id = '1', product_id = '1',date = '2025-12-21' WHERE id = '1';
UPDATE resturantcategory SET category_id = '2', product_id = '5',date = '2025-12-21' WHERE id = '2';
UPDATE resturantcategory SET category_id = '2', product_id = '4',date = '2025-12-21' WHERE id = '3';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:21:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:51:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:21:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:51:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:21:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:51:18", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:21:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:51:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:21:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:51:50", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:22:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:52:00", deviceType = "MOBILE" WHERE userid = -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-21 11:22:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:52:00", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:22:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:52:04", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:24:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:54:42", deviceType = "DESKTOP" WHERE userid = -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-21 11:24:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:54:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:24:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:54:43", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:26:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:56:35", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:26:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:56:42", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:26:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:56:49", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:26:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:56:52", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:26:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:56:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:26:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:56:58", deviceType = "MOBILE" WHERE userid = -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-21 11:26:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:56:58", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:27:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:57:03", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:27:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:57:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:27:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:57:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:27:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:57:45", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:28:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:58:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:28:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:58:11", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:28:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:58:57", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:28:59";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:58:59", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:29:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:59:10", deviceType = "MOBILE" WHERE userid = -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-21 11:29:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:59:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:29:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:59:20", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:29:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:59:25", deviceType = "DESKTOP" WHERE userid = -1;
INSERT INTO restauranttable (hallid, name, beingUsed, userId, sysdate, del) VALUES ('1', 't2', '0', '-1', '2025-12-21', '0'); -- id=2
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:29:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:59:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:29:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:59:36", deviceType = "DESKTOP" WHERE userid = -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-21 11:29:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:59:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:29:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:59:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:29:41";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 14:59:41", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:30:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:00:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:30:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:00:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:30:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:00:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:50:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:20:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:51:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:21:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:08", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:18", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:25", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:32";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:32", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:32";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:32", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:34", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:34", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:35", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:35", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:37", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:37", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:38", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:38", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:48", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:48", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:52:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:22:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:53:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:23:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:54:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:24:11", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 11:54:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:24:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:02:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:32:46", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:02:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:32:53", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:01", deviceType = "DESKTOP" WHERE userid = -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-21 12:03:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:05", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:09", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:11", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:45", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:48", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:53", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:55", deviceType = "DESKTOP" WHERE userid = -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-21 12:03:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:55", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:03:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:33:58", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:04:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:34:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:04:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:34:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:04:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:34:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:04:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:34:11", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:04:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:34:12", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:04:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:34:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:04:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:34:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:04:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:34:15", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 12:04:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 15:34:18", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:54:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:24:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:54:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:24:12", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:54:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:24:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:54:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:24:23", deviceType = "DESKTOP" WHERE userid = -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-21 14:54:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:24:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:54:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:24:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:54:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:24:53", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:54:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:24:57", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:54:59";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:24:59", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:54:59";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:24:59", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:55:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:25:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:55:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:25:09", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:55:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:25:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:55:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:25:16", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE tamweenclientdetail SET clientid = '2', noOfPersonsTamween = '0', noOfPersonsDa3m = '0', cardNum = '', cardPassword = '' WHERE id = '1';
UPDATE accountstree SET name = 'hazem', customName = 'hazem', customNameEn = 'hazem', nameEn = 'hazem', parent = '58', accountNature = '0', theValue = '-470.00', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '-1', del = '0', sysdate = '2025-12-21 18:25:16' WHERE id = '419';
UPDATE client SET clientname = 'hazem', clientaddress = '', clientphone = '', clientmobile = '', clientdetails = '', conditions = '0', clientdate = '2025-12-21 18:25:16', userid = '-1'  , clientareaid = '0'  ,clientcode = '2',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '2' , debtLimit='10000' , typeclientid=',',priceTypeId='-1',lastEditUser = '-1',inUse = '0',card_number = '0',file_faida = '',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',clientRFID = '',postponeDays='0',taxnumber='', password='',clientTypeForTree='0',treeId='419',clientaddress2='',country='',delegateid='-1',webStoreType='0',clientaddress3='',taxfile='.',fileimg='.',tagids='',txtemail='' WHERE clientid = '2';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:55:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:25:16", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:55:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:25:18", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:55:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:25:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:55:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:25:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:57:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:27:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:57:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:27:49", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 14:59:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:29:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:00:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:30:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:00:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:30:57", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:01:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:31:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:01:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:31:22", deviceType = "DESKTOP" WHERE userid = -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-21 15:01:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:31:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:01:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:31:25", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:01:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:31:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:01:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:31:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:01:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:31:34", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:01:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:31:35", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:01:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:31:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:01:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:31:37", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:01:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:31:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:02:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:32:12", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:02:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:32:15", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:02:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:32:19", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:02:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:32:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:02:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:32:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:02:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:32:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:03:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:33:07", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:03:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:33:40", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:03:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:33:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:03:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:33:43", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:03:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:33:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:03:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:33:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:03:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:33:48", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:04:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:34:37", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:04:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:34:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:05:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:35:00", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:05:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:35:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:05:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:35:30", deviceType = "DESKTOP" WHERE userid = -1;

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 0694821b700cfe
-- ----------------------------------------------------------------------------------------------------

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-21 18:35:30', '0694821b700cfe', '1', '0.00', '0', '0', '1', '50.00', '50', '50', '0', '1', '2025-12-21 18:35:30', '', '-1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','50','0','','0','0','50','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2025-12-21','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=32
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','اضافة فاتورة مبيعات','32', '0', '2025-12-21 18:35:30', '-1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '50', '0', null, '0', null, null,'', '0','1','1','0','1','2025-12-21 18:35:30','0','0','',''); -- id=35
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where 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 ('10','00004', '32', '3', '4', '1', '10', '10', '0', '', '0', '2025-12-21 18:35:30', '4', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','3-1,','1','1','0','0','10','10','0','','0','0.00','0','0','0','0'); -- id=37
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 = 37;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4, '2025-12-21', 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-21', 10, 10, 10
                    , 10, 10, 10, 10
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 10, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10, sellCostBuyPrice =sellCostBuyPrice+10
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '-1', storedetaildate = '2025-12-21 18:35:30' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '1', '1', '32', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '7', '-1', '2025-12-21 18:35:30','0','0'); -- id=67
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','00006', '32', '3', '6', '1', '10', '10', '0', '', '0', '2025-12-21 18:35:30', '6', '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=38
UPDATE sellbilldetail SET  lastbuyprice = 10.00 , meanbuyprice = 10.00, lastbuyprice_withDiscount = 10.00, meanbuyprice_withDiscount = 10.00
        , lastbuyprice_withTax = 10, meanbuyprice_withTax = 10
                where sellbilldetailid = 38;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (6, '2025-12-21', 10, 10, 10
                    , 10, 10, 10, 0
                    , 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+0
                            , 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-21', 10, 10, 10
                    , 10, 10, 10, 0
                    , 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+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '-2', userid = '-1', storedetaildate = '2025-12-21 18:35:30' WHERE storedetailid = '6';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('6', '1', '1', '1', '32', 'اضافة فاتورة مبيعات', 'sellbillController.php', '-1', '-2', '-1', '2025-12-21 18:35:30','0','0'); -- id=68
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', '32', '1', '3', '1', '30', '30', '0', '', '0', '2025-12-21 18:35:30', '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=39
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 = 39;
 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-21', 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-21', 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;
UPDATE storedetail SET  productquantity = '-1', userid = '-1', storedetaildate = '2025-12-21 18:35:30' WHERE storedetailid = '3';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('3', '1', '1', '1', '32', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0', '-1', '-1', '2025-12-21 18:35:30','0','0'); -- id=69
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '700',  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 ('650','50', '0', '1', 'اضافة فاتورة مبيعات', '32', '700', '2025-12-21 18:35:30', '-1',  'sellbillController.php','1','','0'); -- id=33
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50', '50', '2025-12-21', '-1', '0', '0', '2025-12-21 18:35:30','اضافة فاتورة مبيعات رقم 32','1','0',null,'0','32','sellbillController.php?do=showDetail&sellbillid=32'); -- id=62
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('62', null, '', '','0');INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50', '50', '2025-12-21', '-1', '0', '0', '2025-12-21 18:35:30','اضافة فاتورة مبيعات رقم 32 - صرف البضاعة من المخزن','1','0',null,'0','32','sellbillController.php?do=showDetail&sellbillid=32'); -- id=63
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('63', null, '', '','0');update sellbill set dailyentryid='62,0,63' where sellbillid=32;
 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-21', 50, 50, 50
                    , 50, 50, 50, 40
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,50, 50, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+50, sellCostBuyPrice =sellCostBuyPrice+50
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+50, sellCostMeanBuyPrice = sellCostMeanBuyPrice+50
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+50, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+50
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+40
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+50
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+50
                        , returnSellVal = returnSellVal+0, 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-21', 50, 50, 50
                    , 50, 50, 50, 40
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,50, 50, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+50, sellCostBuyPrice =sellCostBuyPrice+50
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+50, sellCostMeanBuyPrice = sellCostMeanBuyPrice+50
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+50, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+50
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+40
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+50
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+50
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 50, 50, 50
                    , 50, 50, 50, 40, 50, 50)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+50, netSellCostBuyPrice = netSellCostBuyPrice+50
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+50
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+50
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+50
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+50
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+40
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+50
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+50;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 0694821b700cfe and sellbillId = 32 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:05:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:35:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:06:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:36:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:06:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:36:43", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:06:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:36:48", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:07:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:37:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:07:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:37:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:07:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:37:26", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:07:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:37:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:08:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:08:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:08", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:08:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:12", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:08:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:08:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:16", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:08:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:19", deviceType = "DESKTOP" WHERE userid = -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-21 15:08:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:08:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:22", deviceType = "DESKTOP" WHERE userid = -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-21 15:08:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:08:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:08:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:28", deviceType = "DESKTOP" WHERE userid = -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-21 15:08:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:08:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:38", deviceType = "DESKTOP" WHERE userid = -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-21 15:08:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:38:38", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:09:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:39:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:09:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:39:26", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:09:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:39:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:12:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:42:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:12:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:42:08", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:12:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:42:11", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:12:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:42:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:12:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:42:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:12:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:42:55", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:12:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:42:57", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:12:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:42:58", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:12:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:42:58", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:00", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:03", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:25", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:25", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:26", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:38", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:40", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:45", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:46", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:49", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:53", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:55", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:13:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:43:57", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:14:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:44:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:14:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:44:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:14:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:44:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:14:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:44:08", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:18:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:48:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:19:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:49:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:19:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:49:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:19:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:49:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:19:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:49:38", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:19:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:49:46", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:21:41";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:51:41", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:22:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:52:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:22:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:52:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:22:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:52:08", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:22:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:52:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:22:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:52:17", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:22:32";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:52:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:22:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:52:48", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:22:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:52:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:22:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:52:57", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:25:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:55:00", deviceType = "DESKTOP" WHERE userid = -1;
INSERT INTO offerpricebillprop (clientid, clientname, totalprice,realtotalprice,sysdate,serialno) VALUES ('2','hazem','20','20', '2025-12-21', '20259842'); -- id=1
INSERT INTO offerpricebill (offerpricebillid, productid, productname, sellprice, prodescrption, pronumber, totalprice) VALUES ('1', '2', '', '20.00', '', '1', '20'); -- id=1
INSERT INTO offerpricecondition (introduction,detail) VALUES (' fff','<p>fff</p>
'); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:25:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:55:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:25:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:55:26", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:25:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:55:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:26:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:56:46", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:26:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:56:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:26:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:56:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:26:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:56:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:26:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:56:49", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:26:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:56:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:26:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:56:53", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:26:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:56:53", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:26:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:56:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:26:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:56:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:26:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:56:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:26:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:56:56", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:27:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:57:00", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:27:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:57:08", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:27:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:57:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:27:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:57:17", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:27:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:57:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:27:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 18:57:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:31:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:01:11", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:31:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:01:15", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:31:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:01:18", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:31:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:01:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:31:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:01:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:31:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:01:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:31:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:01:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:32:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:02:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:32:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:02:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:32:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:02:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:32:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:02:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:32:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:02:38", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:33:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:03:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:33:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:03:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:37:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:07:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:37:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:07:25", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:38:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:08:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:38:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:08:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:07", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:16", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:17", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:17", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:17", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:20", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:25", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:25", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:33", deviceType = "DESKTOP" WHERE userid = -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-21 15:39:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:41";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:41", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:43", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:39:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:09:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:40:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:10:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:40:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:10:11", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:40:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:10:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:40:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:10:20", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:40:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:10:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:40:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:10:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:40:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:10:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:40:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:10:43", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:40:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:10:50", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:41:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:11:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:41:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:11:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:41:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:11:05", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:41:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:11:05", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:41:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:11:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:41:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:11:07", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:41:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:11:12", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:41:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:11:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:41:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:11:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:41:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:11:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:41:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:11:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:42:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:12:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:42:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:12:12", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:42:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:12:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:42:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:12:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:42:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:12:53", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:45:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:15:03", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:45:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:15:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:45:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:15:15", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:45:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:15:16", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:45:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:15:17", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:45:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:15:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:46:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:16:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:46:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:16:48", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:47:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:17:13", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:47:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:17:17", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:47:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:17:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:47:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:17:38", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:48:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:18:34", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:48:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:18:43", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:48:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:18:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:49:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:19:03", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:49:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:19:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:49:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:19:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:49:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:19:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:49:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:19:16", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:49:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:19:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:50:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:20:07", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:50:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:20:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:50:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:20:15", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:50:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:20:26", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:50:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:20:29", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:51:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:21:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE userid = -1;
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-21 15:51:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:21:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2025-12-21 19:21:53', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/index.php'); -- id=430
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-21 15:51:53";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2025-12-21 19:21:53', '1', 'handleExpiredCards', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=431
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:52:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:22:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 19:22:03', '1', 'addsellBill', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=432
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:52:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:22:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2025-12-21 19:22:06', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/expensesController.php'); -- id=433
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:52:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:22:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2025-12-21 19:22:25', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/expensesController.php'); -- id=434
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:52:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:22:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2025-12-21 19:22:25', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/expensesController.php'); -- id=435
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:52:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:22:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2025-12-21 19:22:26', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/expensesController.php'); -- id=436
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:52:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:22:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2025-12-21 19:22:26', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/expensesController.php'); -- id=437
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:54:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:24:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2025-12-21 19:24:04', '1', 'bill', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/buyBillController.php?do=bill&billnameid=6'); -- id=438
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:54:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:24:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2025-12-21 19:24:06', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/savedailyController.php'); -- id=439
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:54:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:24:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2025-12-21 19:24:07', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/clientdebt.php'); -- id=440
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:54:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:24:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2025-12-21 19:24:07', '1', 'showallajax', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/clientdebt.php?do=showallajax'); -- id=441
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:54:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:24:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2025-12-21 19:24:37', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/clientdebt.php'); -- id=442
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:54:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:24:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2025-12-21 19:24:37', '1', 'showallajax', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/clientdebt.php?do=showallajax'); -- id=443
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:54:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:24:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 19:24:45', '1', 'addsellBill', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=444
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:54:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:24:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 19:24:55', '1', 'addsellBill', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=445
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:55:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:25:31", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 19:25:31', '1', 'addsellBill', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=446
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:58:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:28:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 19:28:09', '1', 'addsellBill', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=447
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 15:58:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 19:28:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 19:28:33', '1', 'addsellBill', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=448
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:31:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:01:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 20:01:31', '1', 'addsellBill', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=449
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:31:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:01:48", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 20:01:48', '1', 'addsellBill', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=450
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:33:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:03:40", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 20:03:40', '1', 'addsellBill', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=451
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:33:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:03:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 20:03:54', '1', 'show', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=show'); -- id=452
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:35:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:05:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 20:05:05', '1', 'show', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=show'); -- id=453
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:35:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:05:11", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 20:05:11', '1', 'show', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'MOBILE','https://localhost/erp19/controllers/sellbillController.php?do=show'); -- id=454
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:35:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:05:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2025-12-21 20:05:20', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/savedailyController.php'); -- id=455
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:35:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:05:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('claimdebtController.php', '2025-12-21 20:05:26', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/claimdebtController.php'); -- id=456
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:35:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:05:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('claimdebtController.php', '2025-12-21 20:05:31', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/claimdebtController.php'); -- id=457
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:35:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:05:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2025-12-21 20:05:38', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/index.php'); -- id=458
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-21 16:35:38";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2025-12-21 20:05:38', '1', 'handleExpiredCards', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=459
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:37:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:07:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('otherstoremovementController.php', '2025-12-21 20:07:48', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/otherstoremovementController.php'); -- id=460
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:37:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:07:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 20:07:49', '1', 'addsellBill', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=461
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:37:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:07:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2025-12-21 20:07:53', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/storedetailController.php'); -- id=462
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:37:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:07:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2025-12-21 20:07:55', '1', 'addsellBill', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=463
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:38:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:08:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('incomeController.php', '2025-12-21 20:08:22', '1', 'show', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/incomeController.php?do=show'); -- id=464
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:39:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:09:39", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('incomeController.php', '2025-12-21 20:09:39', '1', 'show', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'MOBILE','https://localhost/erp19/controllers/incomeController.php?do=show'); -- id=465
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:39:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:09:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2025-12-21 20:09:54', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/clientController.php'); -- id=466
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:39:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:09:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('claimController.php', '2025-12-21 20:09:58', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/claimController.php'); -- id=467
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:40:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:10:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('claimController.php', '2025-12-21 20:10:50', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/claimController.php'); -- id=468
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:40:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:10:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('claimController.php', '2025-12-21 20:10:53', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/claimController.php'); -- id=469
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:41:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:11:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2025-12-21 20:11:03', '1', '', '127.0.0.1', 'ba:ed:38:b4:b3:d2', 'DESKTOP','https://localhost/erp19/controllers/productController.php'); -- id=470
UPDATE user SET loginip = "" WHERE userid = 1;
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-21 16:41:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:11:11", deviceType = "DESKTOP" WHERE userid = -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-21 16:41:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:11:12", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:42:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:12:20", deviceType = "DESKTOP" WHERE userid = -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-21 16:42:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:12:20", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:42:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:12:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:42:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:12:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:42:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:12:33", deviceType = "DESKTOP" WHERE userid = -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-21 16:42:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:12:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:42:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:12:35", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:43:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:13:58", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:44:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:14:05", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:44:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:14:07", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:44:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:14:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:44:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:14:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:44:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:14:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:44:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:14:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:44:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:14:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:44:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:14:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:44:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:14:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:46:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:16:10", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:46:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:16:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:46:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:16:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:46:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:16:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:46:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:16:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:47:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:17:09", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:47:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:17:51", deviceType = "DESKTOP" WHERE userid = -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-21 16:47:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:17:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:48:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:18:40", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:48:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:18:40", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:48:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:18:46", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:48:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:18:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:48:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:18:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:48:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:18:55", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:49:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:19:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:49:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:19:15", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:49:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:19:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:49:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:19:56", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:26", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:32";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:32", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:43", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:45", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:45", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:46", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:53", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:50:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:20:55", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:51:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:21:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:51:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:21:07", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:51:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:21:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:51:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:21:26", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:51:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:21:31", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:51:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:21:49", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:51:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:21:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:51:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:21:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:52:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:22:16", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:52:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:22:18", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:52:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:22:25", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:52:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:22:26", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:52:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:22:35", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:52:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:22:37", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:52:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:22:45", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:52:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:22:46", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:52:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:22:49", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:52:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:22:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:52:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:22:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:52:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:22:57", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:53:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:23:15", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:53:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:23:18", deviceType = "DESKTOP" WHERE userid = -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-21 16:53:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:23:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:53:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:23:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:53:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:23:46", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:53:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:23:51", deviceType = "DESKTOP" WHERE userid = -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-21 16:53:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:23:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:55:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:25:10", deviceType = "DESKTOP" WHERE userid = -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-21 16:55:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:25:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:57:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:27:35", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:57:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:27:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:57:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:27:49", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:57:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:27:56", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:58:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:28:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:58:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:28:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:58:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:28:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:58:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:28:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:58:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:28:45", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:58:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:28:52", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:59:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:29:00", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:59:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:29:40", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:59:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:29:40", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:59:41";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:29:41", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 16:59:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:29:54", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:00:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:30:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:00:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:30:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:00:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:30:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:00:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:30:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:01:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:31:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:01:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:31:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:01:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:31:09", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:01:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:31:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:01:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:31:12", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:01:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:31:12", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:01:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:31:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:01:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:31:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:01:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:31:15", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:01:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:31:15", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:01:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:31:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:02:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:32:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:02:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:32:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:02:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:32:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:05:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:35:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:05:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:35:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:05:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:35:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:05:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:35:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:05:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:35:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:05:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:35:25", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:05:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:35:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:05:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:35:35", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:05:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:35:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:05:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:35:40", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:05:41";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:35:41", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:05:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:35:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:06:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:36:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:06:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:36:58", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:07:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:37:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:07:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:37:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:08:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:38:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:08:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:38:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:09:20";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:39:20", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:09:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:39:56", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:10:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:40:05", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:10:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:40:09", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:12:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:42:12", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:12:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:42:15", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:12:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:42:17", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:12:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:42:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:12:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:42:25", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:12:27";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:42:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:12:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:42:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:12:32";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:42:32", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:12:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:42:34", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:13:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:13:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:34", deviceType = "DESKTOP" WHERE userid = -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-21 17:13:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:34", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:13:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:38", deviceType = "DESKTOP" WHERE userid = -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-21 17:13:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:38", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:13:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:39", deviceType = "DESKTOP" WHERE userid = -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-21 17:13:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:13:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:39", deviceType = "DESKTOP" WHERE userid = -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-21 17:13:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:13:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:39", deviceType = "DESKTOP" WHERE userid = -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-21 17:13:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:13:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:56", deviceType = "DESKTOP" WHERE userid = -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-21 17:13:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:56", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:13:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:57", deviceType = "DESKTOP" WHERE userid = -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-21 17:13:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:43:57", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:14:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:44:09", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:14:18";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:44:18", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:14:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:44:21", deviceType = "DESKTOP" WHERE userid = -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-21 17:14:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:44:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:14:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:44:36", deviceType = "DESKTOP" WHERE userid = -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-21 17:14:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:44:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:14:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:44:40", deviceType = "DESKTOP" WHERE userid = -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-21 17:14:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:44:40", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:14:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:44:54", deviceType = "DESKTOP" WHERE userid = -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-21 17:14:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:44:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:14:59";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:44:59", deviceType = "DESKTOP" WHERE userid = -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-21 17:14:59";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:44:59", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:15:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:45:03", deviceType = "DESKTOP" WHERE userid = -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-21 17:15:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:45:03", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:15:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:45:07", deviceType = "DESKTOP" WHERE userid = -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-21 17:15:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:45:07", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:15:59";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:45:59", deviceType = "DESKTOP" WHERE userid = -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-21 17:15:59";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:45:59", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:16:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:46:03", deviceType = "DESKTOP" WHERE userid = -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-21 17:16:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:46:03", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:16:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:46:08", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:16:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:46:17", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:16:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:46:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:17:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:47:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:17:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:47:56", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:17:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:47:57", deviceType = "DESKTOP" WHERE userid = -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-21 17:17:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:47:58", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:18:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:48:06", deviceType = "DESKTOP" WHERE userid = -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-21 17:18:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:48:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:18:25";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:48:25", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:18:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:48:35", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:18:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:48:55", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:19:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:49:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:19:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:49:56", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:20:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:50:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:20:17";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:50:17", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:20:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:50:22", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:20:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:50:24", deviceType = "MOBILE" WHERE userid = -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-21 17:20:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:50:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:20:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:50:28", deviceType = "MOBILE" WHERE userid = -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-21 17:20:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:50:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:20:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:50:31", deviceType = "MOBILE" WHERE userid = -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-21 17:20:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:50:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:20:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:50:48", deviceType = "MOBILE" WHERE userid = -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-21 17:20:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:50:48", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:21:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:51:43", deviceType = "DESKTOP" WHERE userid = -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-21 17:21:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:51:43", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:21:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:51:51", deviceType = "MOBILE" WHERE userid = -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-21 17:21:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:51:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:22:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:52:06", deviceType = "DESKTOP" WHERE userid = -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-21 17:22:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:52:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:22:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:52:06", deviceType = "DESKTOP" WHERE userid = -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-21 17:22:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:52:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:22:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:52:07", deviceType = "DESKTOP" WHERE userid = -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-21 17:22:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:52:07", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:22:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:52:07", deviceType = "DESKTOP" WHERE userid = -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-21 17:22:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:52:07", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:22:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:52:12", deviceType = "MOBILE" WHERE userid = -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-21 17:22:12";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:52:12", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:22:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:52:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:24:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:54:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:24:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:54:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:24:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:54:57", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:25:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:55:07", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:25:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:55:33", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:25:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:55:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:25:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:55:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:25:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:55:45", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:26:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:56:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:27:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:57:38", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:27:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:57:43", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:27:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:57:53", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:05", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:13", deviceType = "DESKTOP" WHERE userid = -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-21 17:28:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:21", deviceType = "DESKTOP" WHERE userid = -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-21 17:28:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:26", deviceType = "DESKTOP" WHERE userid = -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-21 17:28:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:26", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:34", deviceType = "DESKTOP" WHERE userid = -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-21 17:28:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:34", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:40", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:41";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:41", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:46";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:46", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:28:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:49", deviceType = "DESKTOP" WHERE userid = -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-21 17:28:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:58:49", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:29:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:59:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:29:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:59:07", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:29:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:59:07", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:29:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:59:09", deviceType = "DESKTOP" WHERE userid = -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-21 17:29:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:59:09", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:29:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:59:21", deviceType = "DESKTOP" WHERE userid = -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-21 17:29:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 20:59:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:31:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:01:23", deviceType = "DESKTOP" WHERE userid = -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-21 17:31:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:01:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:32:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:02:01", deviceType = "DESKTOP" WHERE userid = -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-21 17:32:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:02:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:32:41";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:02:41", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:32:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:02:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:32:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:02:43", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:32:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:02:44", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:32:45";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:02:45", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:32:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:02:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:32:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:02:48", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:32:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:02:48", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:32:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:02:58", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:33:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:03:03", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:33:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:03:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:34:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:04:08", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:34:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:04:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:34:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:04:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:34:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:04:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:34:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:04:34", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:34:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:04:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:34:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:04:40", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:34:53";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:04:53", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:37:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:07:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:38:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:08:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:38:23";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:08:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:38:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:08:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:38:59";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:08:59", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:39:26";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:09:26", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:39:31";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:09:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:39:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:09:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:39:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:09:44", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:39:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:09:56", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:42:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:12:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:42:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:12:11", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:42:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:12:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:42:30";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:12:30", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:42:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:12:33", deviceType = "DESKTOP" WHERE userid = -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-21 17:42:33";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:12:33", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:42:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:12:39", deviceType = "DESKTOP" WHERE userid = -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-21 17:42:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:12:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:42:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:12:40", deviceType = "DESKTOP" WHERE userid = -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-21 17:42:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:12:40", deviceType = "DESKTOP" WHERE userid = -1;
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-21',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-21 17:43:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:13:42", deviceType = "DESKTOP" WHERE userid = -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-21 17:43:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:13:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:43:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:13:50", deviceType = "DESKTOP" WHERE userid = -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-21 17:43:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:13:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:44:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:14:00", deviceType = "DESKTOP" WHERE userid = -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-21 17:44:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:14:01", deviceType = "DESKTOP" WHERE userid = -1;
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-21',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-21 17:46:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:16:08", deviceType = "DESKTOP" WHERE userid = -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-21 17:46:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:16:08", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:46:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:16:15", deviceType = "DESKTOP" WHERE userid = -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-21 17:46:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:16:15", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:46:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:16:35", deviceType = "DESKTOP" WHERE userid = -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-21 17:46:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:16:35", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:46:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:16:56", deviceType = "DESKTOP" WHERE userid = -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-21 17:46:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:16:56", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:47:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:17:13", deviceType = "MOBILE" WHERE userid = -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-21 17:47:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:17:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:47:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:17:19", deviceType = "DESKTOP" WHERE userid = -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-21 17:47:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:17:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:47:22";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:17:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:47:36";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:17:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:48:52";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:18:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:48:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:18:57", deviceType = "DESKTOP" WHERE userid = -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-21 17:48:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:18:57", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:49:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:19:04", deviceType = "DESKTOP" WHERE userid = -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-21 17:49:05";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:19:05", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:51:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:21:39", deviceType = "DESKTOP" WHERE userid = -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-21 17:51:39";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:21:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:51:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:21:44", deviceType = "MOBILE" WHERE userid = -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-21 17:51:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:21:45", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:53:15";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:23:15", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:54:29";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:24:29", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:57:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:27:51", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:57:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:27:55", deviceType = "DESKTOP" WHERE userid = -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-21 17:57:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:27:55", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:57:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:27:58", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:58:03";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:28:03", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:58:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:28:08", deviceType = "DESKTOP" WHERE userid = -1;
INSERT INTO ebillsetting (eTaxNum, eTaxNumBranch, eGovernorate, eCity, eStreet, eBuildingNum, eTaxType, eTaxTypeNum, eCompanyNameInTaxCard, eunitInTax) VALUES ('', '', '', '', '', '', '', '', '', ''); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:59:21";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:29:22", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:59:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:29:28", deviceType = "DESKTOP" WHERE userid = -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-21 17:59:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:29:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 17:59:34";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:29:34", deviceType = "DESKTOP" WHERE userid = -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-21 17:59:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:29:35", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 18:00:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:30:10", deviceType = "MOBILE" WHERE userid = -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-21 18:00:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:30:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 18:00:47";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:30:47", deviceType = "MOBILE" WHERE userid = -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-21 18:00:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:30:48", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 18:01:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:31:58", deviceType = "MOBILE" WHERE userid = -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-21 18:01:58";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:31:58", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 18:02:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:32:02", deviceType = "DESKTOP" WHERE userid = -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-21 18:02:02";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:32:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 18:02:06";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 21:32:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:20:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:50:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:20:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:50:57", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:21:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:51:00", deviceType = "DESKTOP" WHERE userid = -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-21 20:21:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:51:00", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:21:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:51:16", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:21:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:51:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:22:01";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:52:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE ebillsetting SET eTaxNum = '', eTaxNumBranch = '', eGovernorate = '', eCity = '', eStreet = '', eBuildingNum = '', eTaxType = '', eTaxTypeNum = '', eCompanyNameInTaxCard = '', eunitInTax = '' WHERE id = '1';
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-21',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',syncstructure = '1',showPrevPrices = '0',isOpticProg='1',reportsPlusHours = '2' , showM5zon = '1',restaurantStoreId = '1',restuarantPrintTimeout = '8',sumSameProductForStore = '0', editAllPrice = '0', isCafe = '0' ,isRestaurent = '0' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='last_discount',Profitevaluation='last_discount' , delivery='0',premiums = '1',operationnumEdit = '0',noOfDecimalPlaces = '2',unReviewBills = '0', unReviewBillsPass = '123',billReviewNote = '',tamweenBakery = '0',three_months = '0',six_months = '0',twelve_months = '0',eighteen_months = '0',twentyfour_months = '0',thirty_months = '0',sixthirty_months = '0',fortytwo_months = '0',fortyeight_months = '0',mandobCollectionRatio='0',takeAwayClient = '0',restaurantServiceOn = ',0,0,0,',earlyrepayment = '0',visaPay = '0',headerPrint='38e56bc84e0c8adff190ee376e986bbd.png',headerPrintSand='',printSand='0',makeDailyEntry='1',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='0',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='0',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='0',printfoot='',sellorder='0',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='0',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='0',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='0',dailyEntryCostprice='last_discount',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='1',webApiId='0',noBillEditTillPay='0',showDataOfficialContract='0',showprice9='0',showprice10='0',showprice11='0',showprice12='0',showprice13='0',serial3='44a31748dcc9eba74d9b43424c373ad9140cf58047d859719ce4980e548afbebe140fa05fac50dce2c3d75d470ba3f1fdb7cf6a07a52b3cb3685408882a88dc2',associatedtags='0',commentClientChasis='0',dollarExType='1',saudielectronicinvoice='0',saudielectronicinvoclient='0',productDiscount='0' WHERE programsettingsid = '1';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:22:08";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:52:09", deviceType = "DESKTOP" WHERE userid = -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-21 20:22:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:52:09", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:22:09";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:52:10", deviceType = "DESKTOP" WHERE userid = -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-21 20:22:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:52:11", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:22:16";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:52:16", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:22:42";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:52:42", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE ebillsetting SET eTaxNum = '', eTaxNumBranch = '', eGovernorate = '', eCity = '', eStreet = '', eBuildingNum = '', eTaxType = '', eTaxTypeNum = '', eCompanyNameInTaxCard = '', eunitInTax = '' WHERE id = '1';
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-21',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',syncstructure = '1',showPrevPrices = '0',isOpticProg='1',reportsPlusHours = '2' , showM5zon = '1',restaurantStoreId = '1',restuarantPrintTimeout = '8',sumSameProductForStore = '0', editAllPrice = '0', isCafe = '0' ,isRestaurent = '0' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='last_discount',Profitevaluation='last_discount' , delivery='0',premiums = '1',operationnumEdit = '0',noOfDecimalPlaces = '2',unReviewBills = '0', unReviewBillsPass = '123',billReviewNote = '',tamweenBakery = '0',three_months = '0',six_months = '0',twelve_months = '0',eighteen_months = '0',twentyfour_months = '0',thirty_months = '0',sixthirty_months = '0',fortytwo_months = '0',fortyeight_months = '0',mandobCollectionRatio='0',takeAwayClient = '0',restaurantServiceOn = ',0,0,0,',earlyrepayment = '0',visaPay = '0',headerPrint='38e56bc84e0c8adff190ee376e986bbd.png',headerPrintSand='',printSand='0',makeDailyEntry='1',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='0',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='0',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='0',printfoot='',sellorder='0',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='0',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='0',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='0',dailyEntryCostprice='last_discount',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='1',webApiId='0',noBillEditTillPay='0',showDataOfficialContract='0',showprice9='0',showprice10='0',showprice11='0',showprice12='0',showprice13='0',serial3='44a31748dcc9eba74d9b43424c373ad9140cf58047d859719ce4980e548afbebe140fa05fac50dce2c3d75d470ba3f1fdb7cf6a07a52b3cb3685408882a88dc2',associatedtags='0',commentClientChasis='0',dollarExType='1',saudielectronicinvoice='0',saudielectronicinvoclient='0',productDiscount='0' WHERE programsettingsid = '1';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:23:10";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:53:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:23:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:53:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE ebillsetting SET eTaxNum = '', eTaxNumBranch = '', eGovernorate = '', eCity = '', eStreet = '', eBuildingNum = '', eTaxType = '', eTaxTypeNum = '', eCompanyNameInTaxCard = '', eunitInTax = '' WHERE id = '1';
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-21',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',syncstructure = '1',showPrevPrices = '0',isOpticProg='1',reportsPlusHours = '2' , showM5zon = '1',restaurantStoreId = '1',restuarantPrintTimeout = '8',sumSameProductForStore = '0', editAllPrice = '0', isCafe = '1' ,isRestaurent = '1' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='last_discount',Profitevaluation='last_discount' , delivery='0',premiums = '1',operationnumEdit = '0',noOfDecimalPlaces = '2',unReviewBills = '0', unReviewBillsPass = '123',billReviewNote = '',tamweenBakery = '0',three_months = '0',six_months = '0',twelve_months = '0',eighteen_months = '0',twentyfour_months = '0',thirty_months = '0',sixthirty_months = '0',fortytwo_months = '0',fortyeight_months = '0',mandobCollectionRatio='0',takeAwayClient = '0',restaurantServiceOn = ',0,0,0,',earlyrepayment = '0',visaPay = '0',headerPrint='38e56bc84e0c8adff190ee376e986bbd.png',headerPrintSand='',printSand='0',makeDailyEntry='1',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='0',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='0',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='0',printfoot='',sellorder='0',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='0',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='0',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='0',dailyEntryCostprice='last_discount',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='1',webApiId='0',noBillEditTillPay='0',showDataOfficialContract='0',showprice9='0',showprice10='0',showprice11='0',showprice12='0',showprice13='0',serial3='44a31748dcc9eba74d9b43424c373ad9140cf58047d859719ce4980e548afbebe140fa05fac50dce2c3d75d470ba3f1fdb7cf6a07a52b3cb3685408882a88dc2',associatedtags='0',commentClientChasis='0',dollarExType='1',saudielectronicinvoice='0',saudielectronicinvoclient='0',productDiscount='0' WHERE programsettingsid = '1';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:23:24";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:53:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:23:38";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:53:38", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:23:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:53:40", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:23:50";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:53:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:23:57";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:53:57", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE ebillsetting SET eTaxNum = '', eTaxNumBranch = '', eGovernorate = '', eCity = '', eStreet = '', eBuildingNum = '', eTaxType = '', eTaxTypeNum = '', eCompanyNameInTaxCard = '', eunitInTax = '' WHERE id = '1';
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-21',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',syncstructure = '1',showPrevPrices = '0',isOpticProg='1',reportsPlusHours = '2' , showM5zon = '1',restaurantStoreId = '1',restuarantPrintTimeout = '8',sumSameProductForStore = '0', editAllPrice = '0', isCafe = '1' ,isRestaurent = '1' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='last_discount',Profitevaluation='last_discount' , delivery='0',premiums = '1',operationnumEdit = '0',noOfDecimalPlaces = '2',unReviewBills = '0', unReviewBillsPass = '123',billReviewNote = '',tamweenBakery = '0',three_months = '0',six_months = '0',twelve_months = '0',eighteen_months = '0',twentyfour_months = '0',thirty_months = '0',sixthirty_months = '0',fortytwo_months = '0',fortyeight_months = '0',mandobCollectionRatio='0',takeAwayClient = '0',restaurantServiceOn = ',0,0,0,',earlyrepayment = '0',visaPay = '0',headerPrint='38e56bc84e0c8adff190ee376e986bbd.png',headerPrintSand='',printSand='0',makeDailyEntry='1',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='0',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='0',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='0',printfoot='',sellorder='0',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='0',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='0',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='0',dailyEntryCostprice='last_discount',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='1',webApiId='0',noBillEditTillPay='0',showDataOfficialContract='0',showprice9='0',showprice10='0',showprice11='0',showprice12='0',showprice13='0',serial3='44a31748dcc9eba74d9b43424c373ad9140cf58047d859719ce4980e548afbebe140fa05fac50dce2c3d75d470ba3f1fdb7cf6a07a52b3cb3685408882a88dc2',associatedtags='0',commentClientChasis='0',dollarExType='1',saudielectronicinvoice='0',saudielectronicinvoclient='0',productDiscount='0' WHERE programsettingsid = '1';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:24:11";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:54:11", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE ebillsetting SET eTaxNum = '', eTaxNumBranch = '', eGovernorate = '', eCity = '', eStreet = '', eBuildingNum = '', eTaxType = '', eTaxTypeNum = '', eCompanyNameInTaxCard = '', eunitInTax = '' WHERE id = '1';
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-21',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',syncstructure = '1',showPrevPrices = '0',isOpticProg='1',reportsPlusHours = '2' , showM5zon = '1',restaurantStoreId = '1',restuarantPrintTimeout = '8',sumSameProductForStore = '0', editAllPrice = '0', isCafe = '1' ,isRestaurent = '1' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='last_discount',Profitevaluation='last_discount' , delivery='0',premiums = '1',operationnumEdit = '0',noOfDecimalPlaces = '2',unReviewBills = '0', unReviewBillsPass = '123',billReviewNote = '',tamweenBakery = '0',three_months = '0',six_months = '0',twelve_months = '0',eighteen_months = '0',twentyfour_months = '0',thirty_months = '0',sixthirty_months = '0',fortytwo_months = '0',fortyeight_months = '0',mandobCollectionRatio='0',takeAwayClient = '0',restaurantServiceOn = ',0,0,0,',earlyrepayment = '0',visaPay = '0',headerPrint='38e56bc84e0c8adff190ee376e986bbd.png',headerPrintSand='',printSand='0',makeDailyEntry='1',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='0',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='0',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='0',printfoot='',sellorder='0',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='0',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='0',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='0',dailyEntryCostprice='last_discount',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='1',webApiId='0',noBillEditTillPay='0',showDataOfficialContract='0',showprice9='0',showprice10='0',showprice11='0',showprice12='0',showprice13='0',serial3='44a31748dcc9eba74d9b43424c373ad9140cf58047d859719ce4980e548afbebe140fa05fac50dce2c3d75d470ba3f1fdb7cf6a07a52b3cb3685408882a88dc2',associatedtags='0',commentClientChasis='0',dollarExType='1',saudielectronicinvoice='0',saudielectronicinvoclient='0',productDiscount='0' WHERE programsettingsid = '1';
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:25:28";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:55:28", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:25:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:55:35", deviceType = "DESKTOP" WHERE userid = -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-21 20:25:35";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:55:35", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:25:43";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:55:43", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:25:55";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:55:55", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:26:13";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:56:13", deviceType = "DESKTOP" WHERE userid = -1;
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 ('069486ceb0ee02', '2025-12-21 23:55:55', '1', '2629.00', '2729', '0', '0', '100.00',  '100', '0', '100', '1', '2025-12-21 23:56:13', '', '-1', '0', '', '1','1','1','0','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=27
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('00004', '27', '3', '4', '10', '10', '100.00', '0', '', '2025-12-21 23:56:13', '4','','','0','0','0','0','0',null,'10','100','0','0','0','0','0','0','0','0','1'); -- id=27
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2025-12-21 23:55:55', 1, 4, 0, 0
                    , 10, 10, 0, 0, -1, '2025-12-21 23:56:13')
                ON DUPLICATE KEY UPDATE buyprice = 10,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = -1,sysDate = '2025-12-21 23:56:13' ; -- id=26
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('4', '10', '10', '0', 'buyBillController.php', '27', '', '0', '0'); -- id=26
UPDATE product SET  productBuyPrice = "10" WHERE productId = 4 ;
UPDATE buybilldetail SET  quantitybefore = 7 WHERE buybilldetailid = 27 ;
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.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 = '4';
UPDATE buybilldetail SET  lastbuyprice = 10 , meanbuyprice = 10, lastbuyprice_withDiscount = 10, meanbuyprice_withDiscount = 10
        , lastbuyprice_withTax = 10, meanbuyprice_withTax = 10, lastbuyprice_withDiscountAndTax = 10
                where buybilldetailid = 27;
UPDATE productunit SET proUnitBuyPrice  = 10 * productnumber WHERE productid = 4;
UPDATE storedetail SET  productquantity = '17', userid = '-1', storedetaildate = '2025-12-21' WHERE storedetailid = '4';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('4', '1', '10', '0', '27', 'اضافة فاتورة مشتريات', 'buyBillController.php', '7', '17', '-1', '2025-12-21 23:55:55','0','0'); -- id=70
UPDATE supplier SET  suppliercurrentDebt = '2729',suppliercurrentDebtInCurrency= '2729' , userid = '-1', supplierdate = '2025-12-21 23:56:13'   WHERE supplierid = '1';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('1', '2629.00', '100', '0', 'اضافة فاتورة مشتريات', '27', '2729', '2025-12-21 23:55:55', '-1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','100','1','2629','100','2729','0',''); -- id=26
update buybill set dailyentryid='0,0' where buybillid=27;
COMMIT;
UPDATE product SET overAllAveragePrice = 10 WHERE productId = 4;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:26:14";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:56:14", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:26:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:56:19", deviceType = "DESKTOP" WHERE userid = -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-21 20:26:19";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:56:19", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:26:40";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:56:40", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:26:51";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:56:51", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:26:54";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:56:54", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:26:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:56:56", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:27:00";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:57:00", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:27:04";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:57:04", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:27:37";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:57:37", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:27:44";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:57:44", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:27:48";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:57:48", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:27:49";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:57:49", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:28:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:58:07", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:28:56";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:58:56", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2025-12-21 20:29:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:59:07", deviceType = "DESKTOP" WHERE userid = -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-21 20:29:07";
UPDATE user SET loginip = "127.0.0.1", lastactivetime = "2025-12-21 23:59:07", deviceType = "DESKTOP" WHERE userid = -1;
