-- ALTER TABLE elarabygt4it_erp.accountmovement AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.accountmovementkind AUTO_INCREMENT = 4;
-- ALTER TABLE elarabygt4it_erp.accountstree AUTO_INCREMENT = 494;
-- ALTER TABLE elarabygt4it_erp.accountstreefromprog AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.accountstreesetting AUTO_INCREMENT = 7;
-- ALTER TABLE elarabygt4it_erp.assets AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.assetssale AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.assetscat AUTO_INCREMENT = 25;
-- ALTER TABLE elarabygt4it_erp.bank AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.bankaccount AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.billname AUTO_INCREMENT = 7;
-- ALTER TABLE elarabygt4it_erp.billoperation AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.billproperty AUTO_INCREMENT = 130;
-- ALTER TABLE elarabygt4it_erp.bills AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.billsbuy AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.billsettings AUTO_INCREMENT = 1196;
-- ALTER TABLE elarabygt4it_erp.billsproducts AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.billsproductsbuy AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.billsreturn AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.billsreturnproducts AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.billtemplate AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.billtemplatedetail AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.bind AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.bindsettlement AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.boarding AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.branch AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.buyandruternbill AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.buyandruternbillcurr AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.buyandruternbilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.buybill AUTO_INCREMENT = 5;
-- ALTER TABLE elarabygt4it_erp.buybillcurr AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.buybilldetail AUTO_INCREMENT = 13;
-- ALTER TABLE elarabygt4it_erp.buybilldetailoffer AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.buybilloffer AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.buypriceshistorybook AUTO_INCREMENT = 18;
-- ALTER TABLE elarabygt4it_erp.capital AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.cashtransfer AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.checkcontroller AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.checkdeposit AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.checkwithdrawal AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.claimdebts AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.claimreturnsellbills AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.claims AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.claimsclientbills AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.claimsellbills AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.claimstypeclients AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.client AUTO_INCREMENT = 3;
-- ALTER TABLE elarabygt4it_erp.clientarea AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.clientdebtchange AUTO_INCREMENT = 22;
-- ALTER TABLE elarabygt4it_erp.clientpaymentreceiptt AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.clientproductreview AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.clinic AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.collectedparcodestemp AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.commentclient AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.costcenter AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.costcenterdetail AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.country AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.coupons AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.currency AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.dailyentry AUTO_INCREMENT = 797;
-- ALTER TABLE elarabygt4it_erp.dailyentrycreditor AUTO_INCREMENT = 797;
-- ALTER TABLE elarabygt4it_erp.dailyentrydebtor AUTO_INCREMENT = 798;
-- ALTER TABLE elarabygt4it_erp.damagedproduct AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.datedchecked AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.discountcontrol AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.doctorkashf AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.ebillsetting AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.eclientsetting AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.employee AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.employeeattendance AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.employeeattendancesystem AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.employeeclosedaygroupstatus AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.employeeclosedayhistory AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.employeeclosedaystatus AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.employeeclosedaysubgroupstatus AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.employeedoctor AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.employeedoctordebtandpay AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.employeedoctordebtchange AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.employeegroup AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.employeepersonnel AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.employeesubgroup AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.entryproductspurchased AUTO_INCREMENT = 8;
-- ALTER TABLE elarabygt4it_erp.expenseexchange AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.expenses AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.expensestype AUTO_INCREMENT = 65;
-- ALTER TABLE elarabygt4it_erp.goverarea AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.government AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.impotencetreatmentsuppliersave AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.income AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.incometype AUTO_INCREMENT = 8;
-- ALTER TABLE elarabygt4it_erp.insurancecompanies AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.kashf AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.kempiala AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.lastbillidspricesupdated AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.lastbillidsquickprofit AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.maccontrol AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.maintenancecases AUTO_INCREMENT = 5;
-- ALTER TABLE elarabygt4it_erp.maintenancecenters AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.maintenancecomments AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.maintenancecompanies AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.maintenancepolicys AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.maintenanceprocedures AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.maintenances AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.manufacuresetting AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.menuurl AUTO_INCREMENT = 31;
-- ALTER TABLE elarabygt4it_erp.movementmanage AUTO_INCREMENT = 886;
-- ALTER TABLE elarabygt4it_erp.movementmanagedeleted AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_check AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_comreceipt AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_comreceiptdetail AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_comreceiptimage AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_externalmaintenance AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_finishingpayed AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_handedreport AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_initialmaintenance AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_initialmaintenancedetail AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_insurance AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_maintenancereceipt AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_maintenancereceiptfinish AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_producthistory AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_stage AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.m_stageproperity AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.newdbbackup AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.newdbname AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.notics AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.offerpricebill AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.offerpricebillprop AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.offerpricecondition AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.onlinestoresetting AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.onlinestoremainsetting AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.onlinetempcategory AUTO_INCREMENT = 85;
-- ALTER TABLE elarabygt4it_erp.onlinetemporder AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.onlinetemporderclient AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.onlinetemporderproduct AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.onlinetempproduct AUTO_INCREMENT = 1977;
-- ALTER TABLE elarabygt4it_erp.onlinetempstoredetail AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.onlinetempstorereport AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.otherrequest AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.otherstoremovement AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.pages AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.partner AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.partnertransferbetween AUTO_INCREMENT = 25;
-- ALTER TABLE elarabygt4it_erp.partnerwithdrawal AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.paymentmethods AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.paymentnetworks AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.playstationcard AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.playstationclientcard AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.playstationclientcardpayhistory AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.policy AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.product AUTO_INCREMENT = 1323;
-- ALTER TABLE elarabygt4it_erp.productcat AUTO_INCREMENT = 85;
-- ALTER TABLE elarabygt4it_erp.productcatunit AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productingredients AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productionexecution AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productionexecutionoutput AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productionexecutionproduct AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productionexecutionwaste AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productionorder AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productionout AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productionoutdetails AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productionoutmany AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productionoutmanyinproducts AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productionoutmanyoutproducts AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productionrate AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productionrateproduct AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productrecieve AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productrequests AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productserial AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productsetting AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.producttemp AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.producttempunit AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.productunit AUTO_INCREMENT = 1323;
-- ALTER TABLE elarabygt4it_erp.product_images AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.programsettings AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.project AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.projectexchmaterial AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.projectexchmaterialdetail AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.projectexchmaterialdetailreturn AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.projectexchmaterialreturn AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.projectkind AUTO_INCREMENT = 4;
-- ALTER TABLE elarabygt4it_erp.properties AUTO_INCREMENT = 792;
-- ALTER TABLE elarabygt4it_erp.quickprofitclient AUTO_INCREMENT = 21;
-- ALTER TABLE elarabygt4it_erp.quickprofitday AUTO_INCREMENT = 21;
-- ALTER TABLE elarabygt4it_erp.quickprofitgeneral AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.quickprofitproduct AUTO_INCREMENT = 27;
-- ALTER TABLE elarabygt4it_erp.quickprofitstore AUTO_INCREMENT = 27;
-- ALTER TABLE elarabygt4it_erp.religions AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.relusergroupproperties AUTO_INCREMENT = 3982;
-- ALTER TABLE elarabygt4it_erp.rentbill AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.rentbillprop AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.rentproduct AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.rentstore AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.representativecompany AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.restauranthall AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.restaurantkitchenprint AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.restaurantorder AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.restaurantorderdeliverydetails AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.restaurantorderdetails AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.restaurantplaystation AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.restaurantplaystationplay AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.restaurantprinter AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.restaurantrawdestruction AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.restauranttable AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.returnbuybill AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.returnbuybillcurr AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.returnbuybilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.returnsellbill AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.returnsellbillcurr AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.returnsellbilldetail AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.returnsellbillreview AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.richproperity AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.salaryreport AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.saudielectronicinvoice AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.save AUTO_INCREMENT = 3;
-- ALTER TABLE elarabygt4it_erp.savedaily AUTO_INCREMENT = 25;
-- ALTER TABLE elarabygt4it_erp.sellandruternbilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sellbill AUTO_INCREMENT = 14;
-- ALTER TABLE elarabygt4it_erp.sellbillallsavepayments AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sellbillandreturnreview AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sellbillandrutern AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sellbillandruterncurr AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sellbillcurr AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sellbilldetail AUTO_INCREMENT = 20;
-- ALTER TABLE elarabygt4it_erp.sellbilldetailoffer AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sellbilldetailorder AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sellbilldetailtax AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sellbillimage AUTO_INCREMENT = 9;
-- ALTER TABLE elarabygt4it_erp.sellbilloffer AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sellbillorder AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sellbillreview AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.settingoperation AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.shippercompanies AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.simplemanufacturesetting AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.sizecolor AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sizecolorstoredetail AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sliders AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.soldserialproduct AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sparepart AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sparepartstore AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.sparepartstoredetails AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sparepartstorereport AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.stage AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.stagestep AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.stock_import_logs AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.store AUTO_INCREMENT = 3;
-- ALTER TABLE elarabygt4it_erp.storedetail AUTO_INCREMENT = 1323;
-- ALTER TABLE elarabygt4it_erp.storemovement AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.storereport AUTO_INCREMENT = 1366;
-- ALTER TABLE elarabygt4it_erp.studentabsences AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.studentaddsubjectdetails AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.studentaddsubjects AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.students AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.studentsetting AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.studentsexams AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.studentsexamsval AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.studentspaymentsystems AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.studentspays AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.studentsubjectgroupdays AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.studentsubjectgroups AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.studentsubjects AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.suppay AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.supplier AUTO_INCREMENT = 74;
-- ALTER TABLE elarabygt4it_erp.supplierdebtchange AUTO_INCREMENT = 81;
-- ALTER TABLE elarabygt4it_erp.supplieropen AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.supplieropendebtchange AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.supplieropenexchangeorclosing AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.tamweenbill AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.tamweenclientdetail AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.tamweenda3mstatus AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.tamweenremainstatus AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.taskorder AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.taskorderproducts AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.taskscases AUTO_INCREMENT = 6;
-- ALTER TABLE elarabygt4it_erp.temreturnsellbill AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.temreturnsellbilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.temsellandruternbilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.temsellbill AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.temsellbillandrutern AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.temsellbilldetail AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.toworkshoporder AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.toworkshoporderbill AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.transferbtweenbankaccount AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.transfermoney AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.unit AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.user AUTO_INCREMENT = 4;
-- ALTER TABLE elarabygt4it_erp.usergroup AUTO_INCREMENT = 5;
-- ALTER TABLE elarabygt4it_erp.usergroupadmin AUTO_INCREMENT = 1115;
-- ALTER TABLE elarabygt4it_erp.vatpayment AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.wishlist AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.workshop AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.workstation AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.workstationassets AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.workstationworker AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.typeclient AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.typesimpotencetreatment AUTO_INCREMENT = 4;
-- ALTER TABLE elarabygt4it_erp.typesupplier AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.premium AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.premiumclient AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.premiumautomatic AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.premiuminstallments AUTO_INCREMENT = 24;
-- ALTER TABLE elarabygt4it_erp.faida AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.faidaproduct AUTO_INCREMENT = 3;
-- ALTER TABLE elarabygt4it_erp.faidadirector AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.resturantcategory AUTO_INCREMENT = 4;
-- ALTER TABLE elarabygt4it_erp.languages AUTO_INCREMENT = 3;
-- ALTER TABLE elarabygt4it_erp.youtube_link AUTO_INCREMENT = 290;
-- ALTER TABLE elarabygt4it_erp.transferclientaccounts AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.knownways AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sellbillpayed AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.sellbillstatus AUTO_INCREMENT = 14;
-- ALTER TABLE elarabygt4it_erp.saveclose AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.charities AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.beneficiaries AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.beneficiaries_family AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.beneficiaries_eco AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.disease AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.area AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.subvention AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.subventionpay AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.onlinecat AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.onlineproductcat AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.searchfilters AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.savetype AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.storemovement_main AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.charitysearchlog AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.charitiescenter AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.ads AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.billprinter AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.billprint AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.importcontract AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.carfile AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.cartracking AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.shippingfile AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.dollarearnings AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.carreviewer AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.carreview AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.cars AUTO_INCREMENT = 1;
-- ALTER TABLE elarabygt4it_erp.savestock AUTO_INCREMENT = 7;
-- ALTER TABLE elarabygt4it_erp.qrerpuserpass AUTO_INCREMENT = 2;
-- ALTER TABLE elarabygt4it_erp.availableparcode AUTO_INCREMENT = 100001;
-- ALTER TABLE elarabygt4it_erp.sellbillstatushistory AUTO_INCREMENT = 14;
-- ALTER TABLE elarabygt4it_erp.productstore AUTO_INCREMENT = 6;
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE programsettings SET companyname = 'سنتر احمد العربي', address = 'ش الترعة البولاقيه - امام قسم شبرا - مول العتبه', specializtion = 'ملابس جملة', phone = '01064062900', faxnumber = '', email = '', website = '', logo = '4a754be7e82553f312ecf932e16cce7d.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 = '', commercialregistration = '', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '1', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2026-09-29',workerbetweenstores = '1',workshoptimeout = '24',drivertimeout = '3',currancy = 'جنيه',serial='57a85883346811cbf7076a51c5bd887a2e96bf2df777a95668d34a3537aceedfe3f238b684c96d789642405e6f69293dbb311716d957a5ac40fe5570cf297eaf',allowdateedit = '0', clientcode = '1' ,clientserial = '1',timezone = 'Africa/Cairo' , expiredate ='1' , production ='1' , description='1' , service ='0' , date='1' , limitamount = '0' , measuringunit = '1' , print_amount = '0' , billid = '0' , precentages = '1' , realprice = '1' ,delegate_seller = '0' , storeserial = '1' ,clientfieldrequired ='0' , clientcodname='0' , colortype = '0' , nakdyOnly = '0' , nakdyKashf = '0' , discount_pres_direct = '0' , general_discount = '0' , sells_return = '0' ,scunitname ='0',vatValue = '0.00',syncstructure = '1',showPrevPrices = '0',isOpticProg='1',reportsPlusHours = '2' , showM5zon = '1',restaurantStoreId = '1',restuarantPrintTimeout = '8',sumSameProductForStore = '0', editAllPrice = '0', isCafe = '0' ,isRestaurent = '0' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='last_discount',Profitevaluation='last_discount' , delivery='0',premiums = '1',operationnumEdit = '0',noOfDecimalPlaces = '2',unReviewBills = '0', unReviewBillsPass = '123',billReviewNote = '',tamweenBakery = '0',three_months = '0',six_months = '0',twelve_months = '0',eighteen_months = '0',twentyfour_months = '0',thirty_months = '0',sixthirty_months = '0',fortytwo_months = '0',fortyeight_months = '0',mandobCollectionRatio='0',takeAwayClient = '0',restaurantServiceOn = ',0,0,0,',earlyrepayment = '0',visaPay = '0',headerPrint='38e56bc84e0c8adff190ee376e986bbd.png',headerPrintSand='',printSand='0',makeDailyEntry='1',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='0',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='0',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='0',printfoot='',sellorder='0',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='0',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='0',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='0',dailyEntryCostprice='last_discount',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='1',webApiId='0',noBillEditTillPay='0',showDataOfficialContract='0',showprice9='0',showprice10='0',showprice11='0',showprice12='0',showprice13='0',serial3='83b7fcbc8ec5f6680b38c85c5097af3b8f9e24beb34e300c92da2aed73200ef3508d6b04b93e1301b69bf990665657d386b98aa70faa9951dfc2289ed943c6cd',associatedtags='0',commentClientChasis='0',dollarExType='64',saudielectronicinvoice='0',saudielectronicinvoclient='0',productDiscount='0'
                ,reviewRecords='',reviewRecordsLastDate='0000-00-00',showepayrestaurant='0',showSellAllPriceInStoreDetail='0' WHERE programsettingsid = '1';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 05:18:54";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 08:48:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 08:48:54', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=886
UPDATE programsettings SET companyname = 'سنتر احمد العربي', address = 'ش الترعة البولاقيه - امام قسم شبرا - مول العتبه', specializtion = 'ملابس جملة', phone = '01064062900', faxnumber = '', email = '', website = '', logo = '4a754be7e82553f312ecf932e16cce7d.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 = '', commercialregistration = '', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '1', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2026-09-30',workerbetweenstores = '1',workshoptimeout = '24',drivertimeout = '3',currancy = 'جنيه',serial='57a85883346811cbf7076a51c5bd887a2e96bf2df777a95668d34a3537aceedfe3f238b684c96d789642405e6f69293dbb311716d957a5ac40fe5570cf297eaf',allowdateedit = '0', clientcode = '1' ,clientserial = '1',timezone = 'Africa/Cairo' , expiredate ='1' , production ='1' , description='1' , service ='0' , date='1' , limitamount = '0' , measuringunit = '1' , print_amount = '0' , billid = '0' , precentages = '1' , realprice = '1' ,delegate_seller = '0' , storeserial = '1' ,clientfieldrequired ='0' , clientcodname='0' , colortype = '0' , nakdyOnly = '0' , nakdyKashf = '0' , discount_pres_direct = '0' , general_discount = '0' , sells_return = '0' ,scunitname ='0',vatValue = '0.00',syncstructure = '1',showPrevPrices = '0',isOpticProg='1',reportsPlusHours = '2' , showM5zon = '1',restaurantStoreId = '1',restuarantPrintTimeout = '8',sumSameProductForStore = '0', editAllPrice = '0', isCafe = '0' ,isRestaurent = '0' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='last_discount',Profitevaluation='last_discount' , delivery='0',premiums = '1',operationnumEdit = '0',noOfDecimalPlaces = '2',unReviewBills = '0', unReviewBillsPass = '123',billReviewNote = '',tamweenBakery = '0',three_months = '0',six_months = '0',twelve_months = '0',eighteen_months = '0',twentyfour_months = '0',thirty_months = '0',sixthirty_months = '0',fortytwo_months = '0',fortyeight_months = '0',mandobCollectionRatio='0',takeAwayClient = '0',restaurantServiceOn = ',0,0,0,',earlyrepayment = '0',visaPay = '0',headerPrint='38e56bc84e0c8adff190ee376e986bbd.png',headerPrintSand='',printSand='0',makeDailyEntry='1',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='0',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='0',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='0',printfoot='',sellorder='0',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='L.E',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='0',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='0',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='0',dailyEntryCostprice='last_discount',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='1',webApiId='0',noBillEditTillPay='0',showDataOfficialContract='0',showprice9='0',showprice10='0',showprice11='0',showprice12='0',showprice13='0',serial3='83b7fcbc8ec5f6680b38c85c5097af3b8f9e24beb34e300c92da2aed73200ef3508d6b04b93e1301b69bf990665657d386b98aa70faa9951dfc2289ed943c6cd',associatedtags='0',commentClientChasis='0',dollarExType='64',saudielectronicinvoice='0',saudielectronicinvoclient='0',productDiscount='0'
                ,reviewRecords='',reviewRecordsLastDate='0000-00-00',showepayrestaurant='0',showSellAllPriceInStoreDetail='0' WHERE programsettingsid = '1';
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 05:18:54";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-09-30 08:48:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 08:48:54', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=887
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 05:18:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 08:48:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 08:48:55', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=888
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 05:18:55";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-09-30 08:48:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 08:48:55', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=889
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 05:18:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 08:48:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 08:48:57', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=890
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:16:49";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 09:46:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 09:46:49', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=891
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:16:49";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-09-30 09:46:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 09:46:49', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=892
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:16:53";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 09:46:53", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 09:46:53', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=893
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:42:06";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:12:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 10:12:06', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=894
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:42:06";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 10:12:06', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=895
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:46:49";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:16:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:16:49', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=896
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:48:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:18:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 10:18:33', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=897
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:48:33";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-09-30 10:18:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 10:18:33', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=898
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:48:51";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:18:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:18:51', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=899
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:49:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:19:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:19:08', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=900
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:49:26";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:19:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-09-30 10:19:26', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php'); -- id=901
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:49:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:19:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:19:36', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=902
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:49:53";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:19:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:19:53', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=903
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:50:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:20:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:20:13', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=904
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:50:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:20:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:20:21', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=905
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:50:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:20:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:20:36', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=906
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:52:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:22:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 10:22:43', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=907
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:53:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:23:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:23:03', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=908
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 06:53:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:23:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:23:11', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=909
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:02:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:32:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:32:03', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=910
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:02:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:32:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 10:32:55', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=911
INSERT INTO supplier (suppliername, supplieraddress, supplierphone, suppliercurrentDebt, supplierdetails, conditions, userid, supplierdate, dailyentryid, category_id, typesupplier_id,linkedClientId,inUse,suppliercode,goverareaid,namepayeecheck,suppliermobile,warrantyOfficer,warrantymobile,sellername,sellermobile,taxnumber,supplierTypeForTree,treeId,sullpierCurrencyid,suppliercurrentDebtInCurrency,webApiId,shippingDiscountPer) VALUES ('محمد العوضي تريكو', '', '', '', '', '0', '1', '2026-09-30 10:33:20', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=74
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 ('74', '0', '', '0', 'إضافة مورد جديد', '74', '', '2026-09-30 10:33:20', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=81
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('محمد العوضي تريكو', 'محمد العوضي تريكو', 'محمد العوضي تريكو', 'محمد العوضي تريكو', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-09-30 10:33:20'); -- id=494
UPDATE supplier SET suppliername = 'محمد العوضي تريكو', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-09-30', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='494',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '74';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:03:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:33:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:33:36', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=912
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:05:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:35:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:35:07', '1', 'add2', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=913
INSERT INTO productcat (productCatName, productCatDate, productCatDescription, productCatParent, userId, conditions, selldiscount, buydiscount, discounttype,isOptic , buytotal , buyhalf , buypart ,buypricereal,opticServices,logo,inMenu,stopNegativeSale,catExcelid,webApiId,obygyInvestigationCatId,price4,price5,price6,price7,price8,price9,price10,price11,price12,price13) VALUES ('تريكو','2026-09-30','','0', '1','0', '0', '0', '-1', '0', '0', '0', '0','0','','.','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); -- id=85
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (85, 1,'2026-09-30 10:35:07',1)
                ON DUPLICATE KEY UPDATE catid = 85, edited = 1, sysdate = '2026-09-30 10:35:07', userid = 1; -- id=85
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '85', '1', '2026-09-30', '1', '0'); -- id=1
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:05:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:35:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:35:07', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=914
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:05:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:35:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:35:09', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=915
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:05:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:35:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 10:35:17', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=916
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:05:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:35:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:35:28', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=917
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:05:41";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:35:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:35:41', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=918
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:06:27";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:36:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:36:27', '1', 'add2', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=919
INSERT INTO productcat (productCatName, productCatDate, productCatDescription, productCatParent, userId, conditions, selldiscount, buydiscount, discounttype,isOptic , buytotal , buyhalf , buypart ,buypricereal,opticServices,logo,inMenu,stopNegativeSale,catExcelid,webApiId,obygyInvestigationCatId,price4,price5,price6,price7,price8,price9,price10,price11,price12,price13) VALUES ('محمد العوضي تريكو','2026-09-30','','85', '1','0', '0', '0', '-1', '0', '0', '0', '0','0','','.','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); -- id=86
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (86, 1,'2026-09-30 10:36:27',1)
                ON DUPLICATE KEY UPDATE catid = 86, edited = 1, sysdate = '2026-09-30 10:36:27', userid = 1; -- id=86
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '86', '1', '2026-09-30', '1', '0'); -- id=2
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:06:27";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:36:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:36:27', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=920
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:06:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:36:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 10:36:28', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=921
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:06:32";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:36:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:36:32', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=922
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:13:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:43:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:43:09', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=923
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('موديل قطيفه العوضي','','86','0','0','0','0','2026-09-30','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','GS1','','','','0','0','0','0','','0','0','','0','','0','0','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','0','0','0','0','0','0','0','','','0','0','0','0'); -- id=1323
UPDATE product SET productName = 'موديل قطيفه العوضي', productDescription = '', productCatId = '86', productBuyPrice = '0', productSellAllPrice = '0', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01323',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '',lastbuyprice_withDiscount = '0',meanbuyprice = '',meanbuyprice_withDiscount = '0' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1323';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1323', '1.00', '2026-09-30', '1', '0','0132301','0','0','0','0','','0','0','0','0','0','0','0','0','0','0'); -- id=1323
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1323', '1', '0', '1', '2026-09-30'); -- id=1323
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1323', '1', '0', '0', '1323', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1366
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1323, 1,'2026-09-30 10:43:09',1)
                ON DUPLICATE KEY UPDATE productid = 1323, edited = 1, sysdate = '2026-09-30 10:43:09', userid = 1; -- id=1977
UPDATE product SET productName = 'موديل قطيفه العوضي', productDescription = '', productCatId = '86', productBuyPrice = '0.00', productSellAllPrice = '0.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01323',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '',lastbuyprice_withDiscount = '0',meanbuyprice = '',meanbuyprice_withDiscount = '0' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1323';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:13:10";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:43:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:43:10', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=924
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:13:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:43:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:43:21', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=925
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:13:25";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:43:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:43:25', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=926
UPDATE product SET productName = 'موديل قطيفه العوضي', productDescription = '', productCatId = '86', productBuyPrice = '0.00', productSellAllPrice = '0.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01323',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '0.00',meanbuyprice_withDiscount = '0' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1323';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1323, 1,'2026-09-30 10:43:28',1)
                ON DUPLICATE KEY UPDATE productid = 1323, edited = 1, sysdate = '2026-09-30 10:43:28', userid = 1; -- id=1977
UPDATE productunit SET proUnitBuyPrice  = 0.00 * productnumber WHERE productid = 1323;
UPDATE product SET productName = 'موديل قطيفه العوضي', productDescription = '', productCatId = '86', productBuyPrice = '0.00', productSellAllPrice = '0.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01323',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '0.00',meanbuyprice_withDiscount = '0' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1323';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1323, 1,'2026-09-30 10:43:30',1)
                ON DUPLICATE KEY UPDATE productid = 1323, edited = 1, sysdate = '2026-09-30 10:43:30', userid = 1; -- id=1977
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:13:30";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:43:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:43:30', '1', 'edit', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=edit&id=1323'); -- id=927
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:13:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:43:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:43:39', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=928
UPDATE productunit SET proUnitBuyPrice  = 305 * productnumber WHERE productid = 1323;
UPDATE product SET productName = 'موديل قطيفه العوضي', productDescription = '', productCatId = '86', productBuyPrice = '305', productSellAllPrice = '0.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01323',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '152.5',meanbuyprice_withDiscount = '152.5' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='152.5',meanbuyprice_withTax='152.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1323';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1323, 1,'2026-09-30 10:43:46',1)
                ON DUPLICATE KEY UPDATE productid = 1323, edited = 1, sysdate = '2026-09-30 10:43:46', userid = 1; -- id=1977
UPDATE productunit SET proUnitSellAllPrice  = 345 * productnumber  WHERE productid = 1323;
UPDATE product SET productName = 'موديل قطيفه العوضي', productDescription = '', productCatId = '86', productBuyPrice = '305.00', productSellAllPrice = '345', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01323',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '152.50',meanbuyprice_withDiscount = '152.5' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='152.5',meanbuyprice_withTax='152.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1323';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1323, 1,'2026-09-30 10:44:08',1)
                ON DUPLICATE KEY UPDATE productid = 1323, edited = 1, sysdate = '2026-09-30 10:44:08', userid = 1; -- id=1977
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:14:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:44:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:44:33', '1', 'edit', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=edit&id=1323'); -- id=929
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:14:49";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:44:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:44:49', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=update'); -- id=930
BEGIN;
UPDATE product SET productName = 'موديل قطيفه العوضي', productDescription = '', productCatId = '86', productBuyPrice = '305', productSellAllPrice = '345', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01323',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '0',meanbuyprice_withDiscount = '0' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '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='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1323';
UPDATE product SET treeId = 0 WHERE productId = 1323;
UPDATE productunit SET  conditions = 1 WHERE productunitid = 1323;
UPDATE productunit SET unitid = '1', productid = '1323', productnumber = '1.00', productunitdate = '2026-09-30', userid = '1', conditions = '0',proUnitParcode='0132301',proUnitSellAllPrice='345',proUnitSellHalfPrice='0',proUnitSellUnitPrice ='0',proUnitBuyPrice='305',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1323';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1323, 1,'2026-09-30 10:44:49',1)
                ON DUPLICATE KEY UPDATE productid = 1323, edited = 1, sysdate = '2026-09-30 10:44:49', userid = 1; -- id=1977
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:14:51";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:44:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:44:51', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=931
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:14:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:44:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:44:56', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=932
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:15:27";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:45:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:45:27', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=933
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:16:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:46:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:46:13', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=934
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('موديل ايطالي العوضي','','86','350','390','390','390','2026-09-30','0','1','0','','0','0','0','0','0','350','350','350','350','350','0','11.43','11.43','11.43','.','0','0','0','350','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','350','350','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','350','0','0','0','0','0','0','','','0','0','0','0'); -- id=1324
UPDATE product SET productName = 'موديل ايطالي العوضي', productDescription = '', productCatId = '86', productBuyPrice = '350', productSellAllPrice = '390', productSellUnitPrice = '390', productSellHalfPrice = '390', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01324',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350' , buypricereal_precentage = '0' , buytotal_precentage = '11.43' , buyhalf_precentage = '11.43' , buypart_precentage = '11.43',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',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='350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1324';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1324', '1.00', '2026-09-30', '1', '0','0132401','390','390','390','350','','0','0','0','0','0','0','0','0','0','0'); -- id=1324
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1324', '1', '0', '1', '2026-09-30'); -- id=1324
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1324', '1', '0', '0', '1324', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1367
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1324, 1,'2026-09-30 10:46:13',1)
                ON DUPLICATE KEY UPDATE productid = 1324, edited = 1, sysdate = '2026-09-30 10:46:13', userid = 1; -- id=1983
UPDATE product SET productName = 'موديل ايطالي العوضي', productDescription = '', productCatId = '86', productBuyPrice = '350.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01324',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350' , buypricereal_precentage = '0' , buytotal_precentage = '11.43' , buyhalf_precentage = '11.43' , buypart_precentage = '11.43',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',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='350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1324';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:16:14";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:46:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:46:14', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=935
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:16:19";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:46:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:46:19', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=936
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:17:30";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:47:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:47:30', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=937
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:17:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:47:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:47:46', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=938
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:18:15";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:48:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:48:15', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=939
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:18:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:48:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:48:36', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=940
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:20:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:50:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:50:21', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=941
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:27:35";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:57:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:57:35', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=942
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:28:01";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:58:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:58:01', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=943
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:28:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:58:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:58:13', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=944
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:28:37";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:58:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:58:37', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=945
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:28:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:58:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:58:47', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=946
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:29:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 10:59:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 10:59:47', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=947
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:34:54";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:04:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:04:54', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=948
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:35:29";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:05:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:05:29', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=949
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:36:35";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:06:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:06:35', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=950
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:37:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:07:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:07:08', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=951
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:37:27";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:07:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:07:27', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=952
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:37:53";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:07:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:07:53', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=953
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:38:34";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:08:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:08:34', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=954
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:38:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:08:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:08:38', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=955
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:42:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:12:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:12:02', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=956
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:42:37";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:12:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:12:37', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=957
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:42:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:12:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:12:55', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=958
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:43:10";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:13:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:13:10', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=959
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:43:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:13:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:13:39', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=960
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:45:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:15:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:15:07', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=961
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:45:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:15:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:15:55', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=962
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:46:13";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:46:13";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:46:15";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:16:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 11:16:15', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=963
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:46:15";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 11:16:15', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=964
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:46:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:16:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:16:28', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=965
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:46:58";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:16:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:16:58', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=966
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:47:15";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:17:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:17:15', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=967
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:47:30";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:17:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:17:30', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=968
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:52:05";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:22:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:22:05', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=969
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:52:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:22:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 11:22:21', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=970
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:53:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:23:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 11:23:21', '1', 'add2', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=971
INSERT INTO productcat (productCatName, productCatDate, productCatDescription, productCatParent, userId, conditions, selldiscount, buydiscount, discounttype,isOptic , buytotal , buyhalf , buypart ,buypricereal,opticServices,logo,inMenu,stopNegativeSale,catExcelid,webApiId,obygyInvestigationCatId,price4,price5,price6,price7,price8,price9,price10,price11,price12,price13) VALUES ('الجنتل JX','2026-09-30','','85', '1','0', '0', '0', '-1', '0', '0', '0', '0','0','','.','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); -- id=87
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (87, 1,'2026-09-30 11:23:21',1)
                ON DUPLICATE KEY UPDATE catid = 87, edited = 1, sysdate = '2026-09-30 11:23:21', userid = 1; -- id=87
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '87', '1', '2026-09-30', '1', '0'); -- id=3
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:53:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:23:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 11:23:21', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=972
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:53:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:23:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 11:23:23', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=973
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:53:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:23:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:23:28', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=974
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:54:10";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:24:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:24:10', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=975
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('قطيفه الجنتل 390','','87','0','0','0','0','2026-09-30','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','GS1','','','','0','0','0','0','','0','0','','0','','0','0','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','0','0','0','0','0','0','0','','','0','0','0','0'); -- id=1325
UPDATE product SET productName = 'قطيفه الجنتل 390', productDescription = '', productCatId = '87', productBuyPrice = '0', productSellAllPrice = '0', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01325',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '',lastbuyprice_withDiscount = '0',meanbuyprice = '',meanbuyprice_withDiscount = '0' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1325';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1325', '1.00', '2026-09-30', '1', '0','0132501','0','0','0','0','','0','0','0','0','0','0','0','0','0','0'); -- id=1325
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1325', '1', '0', '1', '2026-09-30'); -- id=1325
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1325', '1', '0', '0', '1325', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1368
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1325, 1,'2026-09-30 11:24:10',1)
                ON DUPLICATE KEY UPDATE productid = 1325, edited = 1, sysdate = '2026-09-30 11:24:10', userid = 1; -- id=1984
UPDATE product SET productName = 'قطيفه الجنتل 390', productDescription = '', productCatId = '87', productBuyPrice = '0.00', productSellAllPrice = '0.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01325',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '',lastbuyprice_withDiscount = '0',meanbuyprice = '',meanbuyprice_withDiscount = '0' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1325';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:54:12";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:24:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:24:12', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=976
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:54:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:24:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:24:17', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=977
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:54:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:24:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:24:28', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=978
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1325;
UPDATE product SET productName = 'قطيفه الجنتل 390', productDescription = '', productCatId = '87', productBuyPrice = '350', productSellAllPrice = '0.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01325',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '175',meanbuyprice_withDiscount = '175' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='175',meanbuyprice_withTax='175',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1325';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1325, 1,'2026-09-30 11:24:37',1)
                ON DUPLICATE KEY UPDATE productid = 1325, edited = 1, sysdate = '2026-09-30 11:24:37', userid = 1; -- id=1984
UPDATE productunit SET proUnitSellAllPrice  = 390 * productnumber  WHERE productid = 1325;
UPDATE product SET productName = 'قطيفه الجنتل 390', productDescription = '', productCatId = '87', productBuyPrice = '350.00', productSellAllPrice = '390', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01325',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '175.00',meanbuyprice_withDiscount = '175' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='175',meanbuyprice_withTax='175',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1325';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1325, 1,'2026-09-30 11:24:41',1)
                ON DUPLICATE KEY UPDATE productid = 1325, edited = 1, sysdate = '2026-09-30 11:24:41', userid = 1; -- id=1984
UPDATE productunit SET proUnitSellHalfPrice = 390 * productnumber WHERE productid = 1325;
UPDATE product SET productName = 'قطيفه الجنتل 390', productDescription = '', productCatId = '87', productBuyPrice = '350.00', productSellAllPrice = '390.00', productSellUnitPrice = '0.00', productSellHalfPrice = '390', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01325',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '175.00',meanbuyprice_withDiscount = '175' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='175',meanbuyprice_withTax='175',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1325';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1325, 1,'2026-09-30 11:24:43',1)
                ON DUPLICATE KEY UPDATE productid = 1325, edited = 1, sysdate = '2026-09-30 11:24:43', userid = 1; -- id=1984
UPDATE productunit SET proUnitSellUnitPrice = 390 * productnumber WHERE productid = 1325;
UPDATE product SET productName = 'قطيفه الجنتل 390', productDescription = '', productCatId = '87', productBuyPrice = '350.00', productSellAllPrice = '390.00', productSellUnitPrice = '390', productSellHalfPrice = '390.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01325',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '175.00',meanbuyprice_withDiscount = '175' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='175',meanbuyprice_withTax='175',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1325';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1325, 1,'2026-09-30 11:24:47',1)
                ON DUPLICATE KEY UPDATE productid = 1325, edited = 1, sysdate = '2026-09-30 11:24:47', userid = 1; -- id=1984
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:54:55";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:55:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:25:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:25:03', '1', 'edit', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=edit&id=1325'); -- id=979
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:55:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:25:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:25:16', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=update'); -- id=980
BEGIN;
UPDATE product SET productName = 'قطيفه الجنتل 390', productDescription = '', productCatId = '87', productBuyPrice = '350', productSellAllPrice = '390', productSellUnitPrice = '390', productSellHalfPrice = '390', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01325',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '',meanbuyprice_withDiscount = '0' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '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='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1325';
UPDATE product SET treeId = 0 WHERE productId = 1325;
UPDATE productunit SET  conditions = 1 WHERE productunitid = 1325;
UPDATE productunit SET unitid = '1', productid = '1325', productnumber = '1.00', productunitdate = '2026-09-30', userid = '1', conditions = '0',proUnitParcode='0132501',proUnitSellAllPrice='390',proUnitSellHalfPrice='390',proUnitSellUnitPrice ='390',proUnitBuyPrice='350',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1325';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1325, 1,'2026-09-30 11:25:16',1)
                ON DUPLICATE KEY UPDATE productid = 1325, edited = 1, sysdate = '2026-09-30 11:25:16', userid = 1; -- id=1984
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:55:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:25:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:25:18', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=981
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:55:24";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:25:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:25:24', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=982
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:55:32";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:25:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:25:32', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=983
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:56:06";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:26:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:26:06', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=984
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('مشعر الجنتل 420','','87','380','420','420','420','2026-09-30','0','1','0','','0','0','0','0','0','380','380','380','380','380','0','10.53','0','0','.','0','0','0','380','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','380','380','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','380','0','0','0','0','0','0','','','0','0','0','0'); -- id=1326
UPDATE product SET productName = 'مشعر الجنتل 420', productDescription = '', productCatId = '87', productBuyPrice = '380', productSellAllPrice = '420', productSellUnitPrice = '420', productSellHalfPrice = '420', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01326',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380' , buypricereal_precentage = '0' , buytotal_precentage = '10.53' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='380',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='380',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1326';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1326', '1.00', '2026-09-30', '1', '0','0132601','420','420','420','380','','0','0','0','0','0','0','0','0','0','0'); -- id=1326
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1326', '1', '0', '1', '2026-09-30'); -- id=1326
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1326', '1', '0', '0', '1326', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1369
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1326, 1,'2026-09-30 11:26:06',1)
                ON DUPLICATE KEY UPDATE productid = 1326, edited = 1, sysdate = '2026-09-30 11:26:06', userid = 1; -- id=1990
UPDATE product SET productName = 'مشعر الجنتل 420', productDescription = '', productCatId = '87', productBuyPrice = '380.00', productSellAllPrice = '420.00', productSellUnitPrice = '420.00', productSellHalfPrice = '420.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01326',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380' , buypricereal_precentage = '0' , buytotal_precentage = '10.53' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='380',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='380',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1326';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 07:56:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 11:26:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 11:26:07', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=985
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:00:22";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 11:30: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 < "2026-09-30 08:00:23";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-09-30 11:30:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:01:39";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 11:31:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:01:47";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 11:31:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:01:51";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 11:31:51", deviceType = "DESKTOP" 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 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 blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:14:13";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 11:44:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:15:47";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 11:45:47", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:16:22";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 11:46:22", 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 = 'سنتر احمد العربي', address = 'ش الترعة البولاقيه - امام قسم شبرا - مول العتبه', specializtion = 'ملابس جملة', phone = '01064062900', faxnumber = '', email = '', website = '', logo = '4a754be7e82553f312ecf932e16cce7d.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 = '', commercialregistration = '', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '1', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2026-09-30',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='',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='83b7fcbc8ec5f6680b38c85c5097af3b8f9e24beb34e300c92da2aed73200ef3508d6b04b93e1301b69bf990665657d386b98aa70faa9951dfc2289ed943c6cd',associatedtags='0',commentClientChasis='0',dollarExType='64',saudielectronicinvoice='0',saudielectronicinvoclient='0',productDiscount='0'
                ,reviewRecords='',reviewRecordsLastDate='0000-00-00',showepayrestaurant='0',showSellAllPriceInStoreDetail='0' WHERE programsettingsid = '1';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:16:22";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 11:46:23", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:21:00";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 11:51:00", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:21:11";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 11:51:11", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:26:10";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 11:56:10", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:35:49";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 12:05:49", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:36:31";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 12:06:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:36:41";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 12:06:41", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:36:46";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 12:06:46", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:37:13";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 12:07:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 08:37:24";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 12:07:24", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:15:11";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:15:14";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:45:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 12:45:14', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=986
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:15:14";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 12:45:14', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=987
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:15:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:45:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 12:45:20', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=988
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:17:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:47:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 12:47:45', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=989
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:18:15";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:48:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 12:48:15', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=990
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:20:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:50:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 12:50:04', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=991
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('تقطيع ليزر 2002 ميلانو 480','','37','460','480','480','480','2026-09-30','0','1','0','','0','0','0','0','0','460','460','460','460','460','0','4.35','0','0','.','0','0','0','460','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','460','460','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','460','0','0','0','0','0','0','','','0','0','0','0'); -- id=1327
UPDATE product SET productName = 'تقطيع ليزر 2002 ميلانو 480', productDescription = '', productCatId = '37', productBuyPrice = '460', productSellAllPrice = '480', productSellUnitPrice = '480', productSellHalfPrice = '480', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01327',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460' , buypricereal_precentage = '0' , buytotal_precentage = '4.35' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='460',meanbuyprice_withTax='460',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='460',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1327';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1327', '1', '2026-09-30', '1', '0','0132701','480','480','480','460','','0','0','0','0','0','0','0','0','0','0'); -- id=1327
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1327', '1', '0', '1', '2026-09-30'); -- id=1327
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1327', '1', '0', '0', '1327', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1370
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1327, 1,'2026-09-30 12:50:04',1)
                ON DUPLICATE KEY UPDATE productid = 1327, edited = 1, sysdate = '2026-09-30 12:50:04', userid = 1; -- id=1991
UPDATE product SET productName = 'تقطيع ليزر 2002 ميلانو 480', productDescription = '', productCatId = '37', productBuyPrice = '460.00', productSellAllPrice = '480.00', productSellUnitPrice = '480.00', productSellHalfPrice = '480.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01327',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460' , buypricereal_precentage = '0' , buytotal_precentage = '4.35' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='460',meanbuyprice_withTax='460',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='460',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1327';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('تمساح استراس تقطيع 2018 ميلانو 570','','37','550','570','570','570','2026-09-30','0','1','0','','0','0','0','0','0','550','550','550','550','550','0','3.64','0','0','.','0','0','0','550','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','550','550','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','550','0','0','0','0','0','0','','','0','0','0','0'); -- id=1328
UPDATE product SET productName = 'تمساح استراس تقطيع 2018 ميلانو 570', productDescription = '', productCatId = '37', productBuyPrice = '550', productSellAllPrice = '570', productSellUnitPrice = '570', productSellHalfPrice = '570', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01328',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '550',meanbuyprice_withDiscount = '550' , productbuypricereal = '550' , buypricereal_precentage = '0' , buytotal_precentage = '3.64' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='550',meanbuyprice_withTax='550',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='550',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1328';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1328', '1', '2026-09-30', '1', '0','0132801','570','570','570','550','','0','0','0','0','0','0','0','0','0','0'); -- id=1328
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1328', '1', '0', '1', '2026-09-30'); -- id=1328
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1328', '1', '0', '0', '1328', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1371
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1328, 1,'2026-09-30 12:50:04',1)
                ON DUPLICATE KEY UPDATE productid = 1328, edited = 1, sysdate = '2026-09-30 12:50:04', userid = 1; -- id=1992
UPDATE product SET productName = 'تمساح استراس تقطيع 2018 ميلانو 570', productDescription = '', productCatId = '37', productBuyPrice = '550.00', productSellAllPrice = '570.00', productSellUnitPrice = '570.00', productSellHalfPrice = '570.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01328',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '550',meanbuyprice_withDiscount = '550' , productbuypricereal = '550' , buypricereal_precentage = '0' , buytotal_precentage = '3.64' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='550',meanbuyprice_withTax='550',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='550',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1328';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('حصان الماظ حزام 2021 ميلانو 590','','37','570','590','590','590','2026-09-30','0','1','0','','0','0','0','0','0','570','570','570','570','570','0','3.51','0','0','.','0','0','0','570','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','570','570','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','570','0','0','0','0','0','0','','','0','0','0','0'); -- id=1329
UPDATE product SET productName = 'حصان الماظ حزام 2021 ميلانو 590', productDescription = '', productCatId = '37', productBuyPrice = '570', productSellAllPrice = '590', productSellUnitPrice = '590', productSellHalfPrice = '590', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01329',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '570',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '570' , buypricereal_precentage = '0' , buytotal_precentage = '3.51' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='570',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='570',meanbuyprice_withTax='570',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='570',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1329';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1329', '1', '2026-09-30', '1', '0','0132901','590','590','590','570','','0','0','0','0','0','0','0','0','0','0'); -- id=1329
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1329', '1', '0', '1', '2026-09-30'); -- id=1329
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1329', '1', '0', '0', '1329', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1372
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1329, 1,'2026-09-30 12:50:04',1)
                ON DUPLICATE KEY UPDATE productid = 1329, edited = 1, sysdate = '2026-09-30 12:50:04', userid = 1; -- id=1993
UPDATE product SET productName = 'حصان الماظ حزام 2021 ميلانو 590', productDescription = '', productCatId = '37', productBuyPrice = '570.00', productSellAllPrice = '590.00', productSellUnitPrice = '590.00', productSellHalfPrice = '590.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01329',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '570',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '570' , buypricereal_precentage = '0' , buytotal_precentage = '3.51' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='570',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='570',meanbuyprice_withTax='570',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='570',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1329';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('اميري فوطه كلمه 2022 ميلانو 600','','37','580','600','600','600','2026-09-30','0','1','0','','0','0','0','0','0','580','580','580','580','580','0','3.45','0','0','.','0','0','0','580','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','580','580','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','580','0','0','0','0','0','0','','','0','0','0','0'); -- id=1330
UPDATE product SET productName = 'اميري فوطه كلمه 2022 ميلانو 600', productDescription = '', productCatId = '37', productBuyPrice = '580', productSellAllPrice = '600', productSellUnitPrice = '600', productSellHalfPrice = '600', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01330',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580',lastbuyprice_withDiscount = '580',meanbuyprice = '580',meanbuyprice_withDiscount = '580' , productbuypricereal = '580' , buypricereal_precentage = '0' , buytotal_precentage = '3.45' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='580',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='580',meanbuyprice_withTax='580',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='580',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1330';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1330', '1', '2026-09-30', '1', '0','0133001','600','600','600','580','','0','0','0','0','0','0','0','0','0','0'); -- id=1330
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1330', '1', '0', '1', '2026-09-30'); -- id=1330
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1330', '1', '0', '0', '1330', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1373
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1330, 1,'2026-09-30 12:50:04',1)
                ON DUPLICATE KEY UPDATE productid = 1330, edited = 1, sysdate = '2026-09-30 12:50:04', userid = 1; -- id=1994
UPDATE product SET productName = 'اميري فوطه كلمه 2022 ميلانو 600', productDescription = '', productCatId = '37', productBuyPrice = '580.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01330',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580',lastbuyprice_withDiscount = '580',meanbuyprice = '580',meanbuyprice_withDiscount = '580' , productbuypricereal = '580' , buypricereal_precentage = '0' , buytotal_precentage = '3.45' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='580',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='580',meanbuyprice_withTax='580',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='580',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1330';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:20:06";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:50:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 12:50:06', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=992
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:20:12";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:50:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 12:50:12', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=993
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:20:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:50:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 12:50:23', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=994
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:20:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:50:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 12:50:43', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=995
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:22:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:52:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 12:52:21', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=996
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:23:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:53:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 12:53:09', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=997
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:24:34";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:54:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 12:54:34', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=998
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:26:06";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:56:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('userController.php', '2026-09-30 12:56:06', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/userController.php?do=show'); -- id=999
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:26:15";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:56:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('userController.php', '2026-09-30 12:56:15', '1', 'edit', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/userController.php?do=edit&userid=3'); -- id=1000
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:26:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:56:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('userController.php', '2026-09-30 12:56:57', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/userController.php?do=update'); -- id=1001
UPDATE user SET username = 'احمد عبدلله', password = '500500', usergroupid = '1', employeename = 'احمد عبدلله', currentdate = '2026-09-29', conditions = '0', saveid = '2'  , userstoreid ='1' ,awardrate = '0' ,searchinonesave = '0', branchId = '-1', question = 'اسمك ايه', answer = 'احمد عبدلله',blockedByLimits = '0',directSaveBills = '0',userstoreidDef='1',empid='0',obygyDoctorId = '0',lang = '',viewclients = '1',viewbills = '1',storeSupervisor='0',storeSupervisorStores='',projectids='0',bankids='0',saveids='-1,2',searchinonestorebalance='0',storeids='1',webApiId='0',closeSavid='1',charityids='0',laterNakdiUserIds='-1,-1',awardrategomla = '0',awardratehalf = '0', dellaternakdipayed='1',accountids='-1,' WHERE userid = '3';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:26:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:56:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('userController.php', '2026-09-30 12:56:57', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/userController.php?do=sucess'); -- id=1002
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:26:59";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 12:56:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('userController.php', '2026-09-30 12:56:59', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/userController.php?do=show'); -- id=1003
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 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 blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:31:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:01:11", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 13:01:11', '3', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1004
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:31:11";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 13:01:11', '3', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1005
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:34:05";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:04:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:04:05', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1006
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:36:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:06:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:06:33', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1007
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:37:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:07:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:07:07', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1008
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:37:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:07:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:07:09', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1009
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:37:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:07:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:07:11', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1010
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:37:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:07:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:07:23', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1011
UPDATE productunit SET proUnitSellUnitPrice = 0.00 * productnumber WHERE productid = 1096;
UPDATE product SET productName = 'اميري نسر اخضر 1218', productDescription = '', productCatId = '37', productBuyPrice = '600.00', productSellAllPrice = '620.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09736',type ='0', expireDate = '0' , dailyentryId = '451',isService = '0',isOptic = '0',lastbuyprice = '600.00',lastbuyprice_withDiscount = '600',meanbuyprice = '600.00',meanbuyprice_withDiscount = '600' , productbuypricereal = '600.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='600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9736',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='600',meanbuyprice_withTax='600',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='1',lastbuyprice_withDiscountAndTax='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='1',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1096';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1096, 1,'2026-09-30 13:08:09',1)
                ON DUPLICATE KEY UPDATE productid = 1096, edited = 1, sysdate = '2026-09-30 13:08:09', userid = 1; -- id=1741
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:38:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:08:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:08:09', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1012
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:38:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:08:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:08:18', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1013
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:39:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:09:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:09:08', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1014
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:39:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:09:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:09:20', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1015
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:39:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:09:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:09:46', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1016
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:42:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:12:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:12:03', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1017
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:42:10";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:12:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:12:10', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1018
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:46:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:16:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:16:07', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1019
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:47:01";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:17:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:17:01', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1020
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:48:30";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:18:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:18:30', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1021
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:50:04";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 13:20:04", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:51:08";
UPDATE user SET loginip = "81.10.55.229", lastactivetime = "2026-09-30 13:21:08", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:54:10";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:24:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:24:10', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1022
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:54:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:24:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 13:24:46', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1023

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abcb8c32177a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 13:24:46', '06abcb8c32177a', '1', '0.00', '0', '0', '1', '6635.00', '6635', '6635', '0', '1', '2026-09-30 13:24:46', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '28' ,'0','','','','','-1','0','0','0','0','0','6635','0','','0','0','6635','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-30','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=14
UPDATE client SET  clientdebt = '0', userid = '2' 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','اضافة فاتورة مبيعات','14', '0', '2026-09-30 13:24:46', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '6635', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 13:24:46','0','0','',''); -- id=22
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 1;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','09745', '14', '71', '1247', '16', '200', '3200', '0', '', '0', '2026-09-30 13:24:46', '1247', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1-15,','1','1','0','0','200','3200','0','','0','0.00','0','0','0','0'); -- id=20
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 187.20, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 187.20
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 187.2, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 20;
 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 (1247, '2026-09-30', 3200, 3040, 3040
                    , 2995.2, 3040, 2995.2, 3040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16, 0, 3040, 2995.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2995.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2995.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2995.2
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+16
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3200, 3040, 3040
                    , 2995.2, 3040, 2995.2, 3040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3040, 2995.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2995.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2995.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2995.2
                        , returnSellVal = returnSellVal+0, 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 = '79', userid = '2', storedetaildate = '2026-09-30 13:24:46' WHERE storedetailid = '1247';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1247', '1', '16', '1', '14', 'اضافة فاتورة مبيعات', 'sellbillController.php', '95', '79', '2', '2026-09-30 13:24:46','0','0'); -- id=1374
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 ('235','08530', '14', '74', '1254', '3', '255', '765', '0', '', '0', '2026-09-30 13:24:46', '1254', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','255','765','0','','0','0.00','0','0','0','0'); -- id=21
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 21;
 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 (1254, '2026-09-30', 765, 705, 705
                    , 705, 705, 705, 705
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 705, 705, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+765, sellCostBuyPrice =sellCostBuyPrice+705
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+705, sellCostMeanBuyPrice = sellCostMeanBuyPrice+705
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+705, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+705
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+705
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+705
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+705
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 765, 705, 705
                    , 705, 705, 705, 705
                    , 0, 0, 0, 0
                    , 0, 0, 0, 705, 705, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+765, sellCostBuyPrice =sellCostBuyPrice+705
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+705, sellCostMeanBuyPrice = sellCostMeanBuyPrice+705
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+705, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+705
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+705
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+705
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+705
                        , returnSellVal = returnSellVal+0, 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 = '2', storedetaildate = '2026-09-30 13:24:46' WHERE storedetailid = '1254';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1254', '1', '3', '1', '14', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '12', '2', '2026-09-30 13:24:46','0','0'); -- id=1375
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 ('240','07891', '14', '72', '1250', '6', '260', '1560', '0', '', '0', '2026-09-30 13:24:46', '1250', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','260','1560','0','','0','0.00','0','0','0','0'); -- id=22
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 22;
 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 (1250, '2026-09-30', 1560, 1440, 1440
                    , 1440, 1440, 1440, 1440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1440, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1560, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+6
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1560, 1440, 1440
                    , 1440, 1440, 1440, 1440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1440, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1560, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2026-09-30 13:24:46' WHERE storedetailid = '1250';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1250', '1', '6', '1', '14', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '15', '2', '2026-09-30 13:24:46','0','0'); -- id=1376
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 ('350','09426', '14', '58', '1203', '3', '370', '1110', '0', '', '0', '2026-09-30 13:24:46', '1203', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','370','1110','0','','0','0.00','0','0','0','0'); -- id=23
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 23;
 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 (1203, '2026-09-30', 1110, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1050, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1110, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1110, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1050, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1110, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1050
                        , returnSellVal = returnSellVal+0, 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 = '149', userid = '2', storedetaildate = '2026-09-30 13:24:46' WHERE storedetailid = '1203';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1203', '1', '3', '1', '14', 'اضافة فاتورة مبيعات', 'sellbillController.php', '152', '149', '2', '2026-09-30 13:24:46','0','0'); -- id=1377
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '36935',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('30300','6635', '0', '2', 'اضافة فاتورة مبيعات', '14', '36935', '2026-09-30 13:24:46', '2',  'sellbillController.php','1','','0'); -- id=25
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6635', '6635', '2026-09-30', '2', '0', '0', '2026-09-30 13:24:46','اضافة فاتورة مبيعات رقم 14','1','0',null,'0','14','sellbillController.php?do=showDetail&sellbillid=14'); -- id=797
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('797', '419', '6635', '','0'); -- id=798
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '36935', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('797', '143', '6635', '','0'); -- id=797
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '57185', 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 ( '6235', '6235', '2026-09-30', '2', '0', '0', '2026-09-30 13:24:46','اضافة فاتورة مبيعات رقم 14 - صرف البضاعة من المخزن','1','0',null,'0','14','sellbillController.php?do=showDetail&sellbillid=14'); -- id=798
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('798', '402', '6235', '','0'); -- id=799
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '62890', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('798', '382', '6235', '','0'); -- id=798
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12294700', 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='797,0,798' where sellbillid=14;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 6635, 6235, 6235
                    , 6190.2, 6235, 6190.2, 6235
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6235, 6190.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6635, sellCostBuyPrice =sellCostBuyPrice+6235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6190.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6190.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6190.2
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6635, 6235, 6235
                    , 6190.2, 6235, 6190.2, 6235
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6235, 6190.2, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6635, sellCostBuyPrice =sellCostBuyPrice+6235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6235, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6190.2
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6235, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6190.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6235
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6235
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6190.2
                        , returnSellVal = returnSellVal+0, 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, 6635, 6235, 6235
                    , 6190.2, 6235, 6190.2, 6235, 6235, 6190.2)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+6635, netSellCostBuyPrice = netSellCostBuyPrice+6235
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6235
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6190.2
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6235
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6190.2
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6235
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6235
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+6190.2;
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:54:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:24:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 13:24:46', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1024
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:58:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:28:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:28:42', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1025
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 09:59:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:29:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:29:50', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1026
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:00:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:30:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:30:48', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1027
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:02:58";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:32:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:32:58', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1028
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:05:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:35:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:35:46', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1029
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:06:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:36:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:36:17', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1030
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:09:34";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:39:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:39:34', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1031
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:11:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:41:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:41:23', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1032
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:11:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:41:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:41:42', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1033
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:12:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:42:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:42:50', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1034
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:12:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:42:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:42:56', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1035
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:13:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:43:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:43:13', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1036
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:14:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:44:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:44:04', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1037
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:16:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:46:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:46:16', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=1038
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('الدولي جينز 608','','8','600','620','620','620','2026-09-30','0','1','0','','0','0','0','0','0','600','600','600','600','600','0','3.33','3.33','0','.','0','0','0','600','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','600','600','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','600','0','0','0','0','0','0','','','0','0','0','0'); -- id=1331
UPDATE product SET productName = 'الدولي جينز 608', productDescription = '', productCatId = '8', productBuyPrice = '600', productSellAllPrice = '620', productSellUnitPrice = '620', productSellHalfPrice = '620', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01331',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600' , buypricereal_precentage = '0' , buytotal_precentage = '3.33' , buyhalf_precentage = '3.33' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='600',meanbuyprice_withTax='600',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='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1331';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1331', '1', '2026-09-30', '1', '0','0133101','620','620','620','600','','0','0','0','0','0','0','0','0','0','0'); -- id=1331
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1331', '1', '0', '1', '2026-09-30'); -- id=1331
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1331', '1', '0', '0', '1331', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1378
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1331, 1,'2026-09-30 13:46:16',1)
                ON DUPLICATE KEY UPDATE productid = 1331, edited = 1, sysdate = '2026-09-30 13:46:16', userid = 1; -- id=1996
UPDATE product SET productName = 'الدولي جينز 608', productDescription = '', productCatId = '8', productBuyPrice = '600.00', productSellAllPrice = '620.00', productSellUnitPrice = '620.00', productSellHalfPrice = '620.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01331',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600' , buypricereal_precentage = '0' , buytotal_precentage = '3.33' , buyhalf_precentage = '3.33' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='600',meanbuyprice_withTax='600',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='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1331';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('الدولي جينز 607','','8','650','670','670','670','2026-09-30','0','1','0','','0','0','0','0','0','650','650','650','650','650','0','3.08','0','0','.','0','0','0','650','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','650','650','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','650','0','0','0','0','0','0','','','0','0','0','0'); -- id=1332
UPDATE product SET productName = 'الدولي جينز 607', productDescription = '', productCatId = '8', productBuyPrice = '650', productSellAllPrice = '670', productSellUnitPrice = '670', productSellHalfPrice = '670', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01332',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '650',meanbuyprice = '650',meanbuyprice_withDiscount = '650' , productbuypricereal = '650' , buypricereal_precentage = '0' , buytotal_precentage = '3.08' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='650',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='650',meanbuyprice_withTax='650',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='650',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1332';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1332', '1', '2026-09-30', '1', '0','0133201','670','670','670','650','','0','0','0','0','0','0','0','0','0','0'); -- id=1332
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1332', '1', '0', '1', '2026-09-30'); -- id=1332
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1332', '1', '0', '0', '1332', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1379
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1332, 1,'2026-09-30 13:46:16',1)
                ON DUPLICATE KEY UPDATE productid = 1332, edited = 1, sysdate = '2026-09-30 13:46:16', userid = 1; -- id=1997
UPDATE product SET productName = 'الدولي جينز 607', productDescription = '', productCatId = '8', productBuyPrice = '650.00', productSellAllPrice = '670.00', productSellUnitPrice = '670.00', productSellHalfPrice = '670.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01332',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '650',meanbuyprice = '650',meanbuyprice_withDiscount = '650' , productbuypricereal = '650' , buypricereal_precentage = '0' , buytotal_precentage = '3.08' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='650',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='650',meanbuyprice_withTax='650',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='650',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1332';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('الدولي جينز 606','','8','510','530','530','530','2026-09-30','0','1','0','','0','0','0','0','0','510','510','510','510','510','0','3.92','3.92','0','.','0','0','0','510','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','510','510','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','510','0','0','0','0','0','0','','','0','0','0','0'); -- id=1333
UPDATE product SET productName = 'الدولي جينز 606', productDescription = '', productCatId = '8', productBuyPrice = '510', productSellAllPrice = '530', productSellUnitPrice = '530', productSellHalfPrice = '530', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01333',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '510',meanbuyprice = '510',meanbuyprice_withDiscount = '510' , productbuypricereal = '510' , buypricereal_precentage = '0' , buytotal_precentage = '3.92' , buyhalf_precentage = '3.92' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='510',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='510',meanbuyprice_withTax='510',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='510',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1333';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1333', '1', '2026-09-30', '1', '0','0133301','530','530','530','510','','0','0','0','0','0','0','0','0','0','0'); -- id=1333
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1333', '1', '0', '1', '2026-09-30'); -- id=1333
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1333', '1', '0', '0', '1333', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1380
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1333, 1,'2026-09-30 13:46:16',1)
                ON DUPLICATE KEY UPDATE productid = 1333, edited = 1, sysdate = '2026-09-30 13:46:16', userid = 1; -- id=1998
UPDATE product SET productName = 'الدولي جينز 606', productDescription = '', productCatId = '8', productBuyPrice = '510.00', productSellAllPrice = '530.00', productSellUnitPrice = '530.00', productSellHalfPrice = '530.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01333',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '510',meanbuyprice = '510',meanbuyprice_withDiscount = '510' , productbuypricereal = '510' , buypricereal_precentage = '0' , buytotal_precentage = '3.92' , buyhalf_precentage = '3.92' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='510',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='510',meanbuyprice_withTax='510',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='510',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1333';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('الدولي جينز 558','','8','565','585','585','585','2026-09-30','0','1','0','','0','0','0','0','0','565','565','565','565','565','0','3.54','0','0','.','0','0','0','565','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','565','565','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','565','0','0','0','0','0','0','','','0','0','0','0'); -- id=1334
UPDATE product SET productName = 'الدولي جينز 558', productDescription = '', productCatId = '8', productBuyPrice = '565', productSellAllPrice = '585', productSellUnitPrice = '585', productSellHalfPrice = '585', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01334',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '565',lastbuyprice_withDiscount = '565',meanbuyprice = '565',meanbuyprice_withDiscount = '565' , productbuypricereal = '565' , buypricereal_precentage = '0' , buytotal_precentage = '3.54' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='565',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='565',meanbuyprice_withTax='565',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='565',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1334';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1334', '1', '2026-09-30', '1', '0','0133401','585','585','585','565','','0','0','0','0','0','0','0','0','0','0'); -- id=1334
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1334', '1', '0', '1', '2026-09-30'); -- id=1334
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1334', '1', '0', '0', '1334', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1381
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1334, 1,'2026-09-30 13:46:16',1)
                ON DUPLICATE KEY UPDATE productid = 1334, edited = 1, sysdate = '2026-09-30 13:46:16', userid = 1; -- id=1999
UPDATE product SET productName = 'الدولي جينز 558', productDescription = '', productCatId = '8', productBuyPrice = '565.00', productSellAllPrice = '585.00', productSellUnitPrice = '585.00', productSellHalfPrice = '585.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01334',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '565',lastbuyprice_withDiscount = '565',meanbuyprice = '565',meanbuyprice_withDiscount = '565' , productbuypricereal = '565' , buypricereal_precentage = '0' , buytotal_precentage = '3.54' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='565',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='565',meanbuyprice_withTax='565',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='565',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1334';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('الدولي جينز 605','','8','630','650','650','650','2026-09-30','0','1','0','','0','0','0','0','0','630','630','630','630','630','0','3.17','0','0','.','0','0','0','630','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','630','630','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','630','0','0','0','0','0','0','','','0','0','0','0'); -- id=1335
UPDATE product SET productName = 'الدولي جينز 605', productDescription = '', productCatId = '8', productBuyPrice = '630', productSellAllPrice = '650', productSellUnitPrice = '650', productSellHalfPrice = '650', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01335',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630',lastbuyprice_withDiscount = '630',meanbuyprice = '630',meanbuyprice_withDiscount = '630' , productbuypricereal = '630' , buypricereal_precentage = '0' , buytotal_precentage = '3.17' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='630',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='630',meanbuyprice_withTax='630',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1335';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1335', '1', '2026-09-30', '1', '0','0133501','650','650','650','630','','0','0','0','0','0','0','0','0','0','0'); -- id=1335
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1335', '1', '0', '1', '2026-09-30'); -- id=1335
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1335', '1', '0', '0', '1335', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1382
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1335, 1,'2026-09-30 13:46:16',1)
                ON DUPLICATE KEY UPDATE productid = 1335, edited = 1, sysdate = '2026-09-30 13:46:16', userid = 1; -- id=2000
UPDATE product SET productName = 'الدولي جينز 605', productDescription = '', productCatId = '8', productBuyPrice = '630.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01335',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630',lastbuyprice_withDiscount = '630',meanbuyprice = '630',meanbuyprice_withDiscount = '630' , productbuypricereal = '630' , buypricereal_precentage = '0' , buytotal_precentage = '3.17' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='630',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='630',meanbuyprice_withTax='630',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1335';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('الدولي جينز 609','','8','545','565','565','565','2026-09-30','0','1','0','','0','0','0','0','0','545','545','545','545','545','0','3.67','0','0','.','0','0','0','545','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','545','545','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','545','0','0','0','0','0','0','','','0','0','0','0'); -- id=1336
UPDATE product SET productName = 'الدولي جينز 609', productDescription = '', productCatId = '8', productBuyPrice = '545', productSellAllPrice = '565', productSellUnitPrice = '565', productSellHalfPrice = '565', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01336',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '545',lastbuyprice_withDiscount = '545',meanbuyprice = '545',meanbuyprice_withDiscount = '545' , productbuypricereal = '545' , buypricereal_precentage = '0' , buytotal_precentage = '3.67' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='545',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='545',meanbuyprice_withTax='545',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='545',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1336';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1336', '1', '2026-09-30', '1', '0','0133601','565','565','565','545','','0','0','0','0','0','0','0','0','0','0'); -- id=1336
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1336', '1', '0', '1', '2026-09-30'); -- id=1336
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1336', '1', '0', '0', '1336', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1383
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1336, 1,'2026-09-30 13:46:16',1)
                ON DUPLICATE KEY UPDATE productid = 1336, edited = 1, sysdate = '2026-09-30 13:46:16', userid = 1; -- id=2001
UPDATE product SET productName = 'الدولي جينز 609', productDescription = '', productCatId = '8', productBuyPrice = '545.00', productSellAllPrice = '565.00', productSellUnitPrice = '565.00', productSellHalfPrice = '565.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01336',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '545',lastbuyprice_withDiscount = '545',meanbuyprice = '545',meanbuyprice_withDiscount = '545' , productbuypricereal = '545' , buypricereal_precentage = '0' , buytotal_precentage = '3.67' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='545',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='545',meanbuyprice_withTax='545',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='545',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1336';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('الدولي جينز 610','','8','655','685','685','685','2026-09-30','0','1','0','','0','0','0','0','0','655','655','655','655','655','0','4.58','0','0','.','0','0','0','655','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','655','655','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','655','0','0','0','0','0','0','','','0','0','0','0'); -- id=1337
UPDATE product SET productName = 'الدولي جينز 610', productDescription = '', productCatId = '8', productBuyPrice = '655', productSellAllPrice = '685', productSellUnitPrice = '685', productSellHalfPrice = '685', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01337',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '655',lastbuyprice_withDiscount = '655',meanbuyprice = '655',meanbuyprice_withDiscount = '655' , productbuypricereal = '655' , buypricereal_precentage = '0' , buytotal_precentage = '4.58' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='655',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='655',meanbuyprice_withTax='655',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='655',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1337';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1337', '1', '2026-09-30', '1', '0','0133701','685','685','685','655','','0','0','0','0','0','0','0','0','0','0'); -- id=1337
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1337', '1', '0', '1', '2026-09-30'); -- id=1337
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1337', '1', '0', '0', '1337', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1384
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1337, 1,'2026-09-30 13:46:16',1)
                ON DUPLICATE KEY UPDATE productid = 1337, edited = 1, sysdate = '2026-09-30 13:46:16', userid = 1; -- id=2002
UPDATE product SET productName = 'الدولي جينز 610', productDescription = '', productCatId = '8', productBuyPrice = '655.00', productSellAllPrice = '685.00', productSellUnitPrice = '685.00', productSellHalfPrice = '685.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01337',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '655',lastbuyprice_withDiscount = '655',meanbuyprice = '655',meanbuyprice_withDiscount = '655' , productbuypricereal = '655' , buypricereal_precentage = '0' , buytotal_precentage = '4.58' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='655',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='655',meanbuyprice_withTax='655',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='655',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1337';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:16:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:46:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:46:18', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1039
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:16:26";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:46:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:46:26', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1040
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:17:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:47:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:47:17', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1041
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:18:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:48:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:48:00', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1042
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:18:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:48:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:48:57', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1043
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:19:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:49:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:49:42', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1044
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:20:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:50:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:50:33', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1045
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:24:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:54:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:54:38', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1046
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:25:06";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:55:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:55:06', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1047
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:26:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:56:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:56:08', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1048
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:26:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 13:56:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 13:56:48', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1049
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:30:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:00:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:00:17', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1050
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:30:19";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:00:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:00:19', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1051
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:32:52";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:02:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:02:52', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=1052
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('فولكانو جينز 721','','28','700','720','720','720','2026-09-30','0','1','0','','0','0','0','0','0','700','700','700','700','700','0','2.86','0','0','.','0','0','0','700','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','700','700','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','700','0','0','0','0','0','0','','','0','0','0','0'); -- id=1338
UPDATE product SET productName = 'فولكانو جينز 721', productDescription = '', productCatId = '28', productBuyPrice = '700', productSellAllPrice = '720', productSellUnitPrice = '720', productSellHalfPrice = '720', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01338',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '700',lastbuyprice_withDiscount = '700',meanbuyprice = '700',meanbuyprice_withDiscount = '700' , productbuypricereal = '700' , buypricereal_precentage = '0' , buytotal_precentage = '2.86' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='700',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='700',meanbuyprice_withTax='700',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='700',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1338';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1338', '1', '2026-09-30', '1', '0','0133801','720','720','720','700','','0','0','0','0','0','0','0','0','0','0'); -- id=1338
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1338', '1', '0', '1', '2026-09-30'); -- id=1338
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1338', '1', '0', '0', '1338', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1385
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1338, 1,'2026-09-30 14:02:52',1)
                ON DUPLICATE KEY UPDATE productid = 1338, edited = 1, sysdate = '2026-09-30 14:02:52', userid = 1; -- id=2003
UPDATE product SET productName = 'فولكانو جينز 721', productDescription = '', productCatId = '28', productBuyPrice = '700.00', productSellAllPrice = '720.00', productSellUnitPrice = '720.00', productSellHalfPrice = '720.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01338',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '700',lastbuyprice_withDiscount = '700',meanbuyprice = '700',meanbuyprice_withDiscount = '700' , productbuypricereal = '700' , buypricereal_precentage = '0' , buytotal_precentage = '2.86' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='700',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='700',meanbuyprice_withTax='700',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='700',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1338';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('فولكانو جينز 1250','','28','430','450','450','450','2026-09-30','0','1','0','','0','0','0','0','0','430','430','430','430','430','0','4.65','0','0','.','0','0','0','430','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','430','430','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','430','0','0','0','0','0','0','','','0','0','0','0'); -- id=1339
UPDATE product SET productName = 'فولكانو جينز 1250', productDescription = '', productCatId = '28', productBuyPrice = '430', productSellAllPrice = '450', productSellUnitPrice = '450', productSellHalfPrice = '450', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01339',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430',lastbuyprice_withDiscount = '430',meanbuyprice = '430',meanbuyprice_withDiscount = '430' , productbuypricereal = '430' , buypricereal_precentage = '0' , buytotal_precentage = '4.65' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1339';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1339', '1', '2026-09-30', '1', '0','0133901','450','450','450','430','','0','0','0','0','0','0','0','0','0','0'); -- id=1339
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1339', '1', '0', '1', '2026-09-30'); -- id=1339
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1339', '1', '0', '0', '1339', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1386
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1339, 1,'2026-09-30 14:02:52',1)
                ON DUPLICATE KEY UPDATE productid = 1339, edited = 1, sysdate = '2026-09-30 14:02:52', userid = 1; -- id=2004
UPDATE product SET productName = 'فولكانو جينز 1250', productDescription = '', productCatId = '28', productBuyPrice = '430.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01339',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430',lastbuyprice_withDiscount = '430',meanbuyprice = '430',meanbuyprice_withDiscount = '430' , productbuypricereal = '430' , buypricereal_precentage = '0' , buytotal_precentage = '4.65' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1339';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('فولكانو جينز 720','','28','630','650','650','650','2026-09-30','0','1','0','','0','0','0','0','0','630','630','630','630','630','0','3.17','0','0','.','0','0','0','630','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','630','630','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','630','0','0','0','0','0','0','','','0','0','0','0'); -- id=1340
UPDATE product SET productName = 'فولكانو جينز 720', productDescription = '', productCatId = '28', productBuyPrice = '630', productSellAllPrice = '650', productSellUnitPrice = '650', productSellHalfPrice = '650', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01340',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630',lastbuyprice_withDiscount = '630',meanbuyprice = '630',meanbuyprice_withDiscount = '630' , productbuypricereal = '630' , buypricereal_precentage = '0' , buytotal_precentage = '3.17' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='630',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='630',meanbuyprice_withTax='630',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1340';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1340', '1', '2026-09-30', '1', '0','0134001','650','650','650','630','','0','0','0','0','0','0','0','0','0','0'); -- id=1340
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1340', '1', '0', '1', '2026-09-30'); -- id=1340
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1340', '1', '0', '0', '1340', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1387
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1340, 1,'2026-09-30 14:02:52',1)
                ON DUPLICATE KEY UPDATE productid = 1340, edited = 1, sysdate = '2026-09-30 14:02:52', userid = 1; -- id=2005
UPDATE product SET productName = 'فولكانو جينز 720', productDescription = '', productCatId = '28', productBuyPrice = '630.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01340',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630',lastbuyprice_withDiscount = '630',meanbuyprice = '630',meanbuyprice_withDiscount = '630' , productbuypricereal = '630' , buypricereal_precentage = '0' , buytotal_precentage = '3.17' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='630',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='630',meanbuyprice_withTax='630',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1340';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('فولكانو جينز 719','','28','625','645','645','645','2026-09-30','0','1','0','','0','0','0','0','0','625','625','625','625','625','0','3.2','3.2','0','.','0','0','0','625','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','625','625','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','625','0','0','0','0','0','0','','','0','0','0','0'); -- id=1341
UPDATE product SET productName = 'فولكانو جينز 719', productDescription = '', productCatId = '28', productBuyPrice = '625', productSellAllPrice = '645', productSellUnitPrice = '645', productSellHalfPrice = '645', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01341',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '625',lastbuyprice_withDiscount = '625',meanbuyprice = '625',meanbuyprice_withDiscount = '625' , productbuypricereal = '625' , buypricereal_precentage = '0' , buytotal_precentage = '3.2' , buyhalf_precentage = '3.2' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='625',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='625',meanbuyprice_withTax='625',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='625',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1341';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1341', '1', '2026-09-30', '1', '0','0134101','645','645','645','625','','0','0','0','0','0','0','0','0','0','0'); -- id=1341
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1341', '1', '0', '1', '2026-09-30'); -- id=1341
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1341', '1', '0', '0', '1341', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1388
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1341, 1,'2026-09-30 14:02:52',1)
                ON DUPLICATE KEY UPDATE productid = 1341, edited = 1, sysdate = '2026-09-30 14:02:52', userid = 1; -- id=2006
UPDATE product SET productName = 'فولكانو جينز 719', productDescription = '', productCatId = '28', productBuyPrice = '625.00', productSellAllPrice = '645.00', productSellUnitPrice = '645.00', productSellHalfPrice = '645.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01341',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '625',lastbuyprice_withDiscount = '625',meanbuyprice = '625',meanbuyprice_withDiscount = '625' , productbuypricereal = '625' , buypricereal_precentage = '0' , buytotal_precentage = '3.2' , buyhalf_precentage = '3.2' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='625',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='625',meanbuyprice_withTax='625',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='625',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1341';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('فولكانو جينز 723','','28','750','770','770','770','2026-09-30','0','1','0','','0','0','0','0','0','750','750','750','750','750','0','2.67','0','0','.','0','0','0','750','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','750','750','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','750','0','0','0','0','0','0','','','0','0','0','0'); -- id=1342
UPDATE product SET productName = 'فولكانو جينز 723', productDescription = '', productCatId = '28', productBuyPrice = '750', productSellAllPrice = '770', productSellUnitPrice = '770', productSellHalfPrice = '770', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01342',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '750',lastbuyprice_withDiscount = '750',meanbuyprice = '750',meanbuyprice_withDiscount = '750' , productbuypricereal = '750' , buypricereal_precentage = '0' , buytotal_precentage = '2.67' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='750',meanbuyprice_withTax='750',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1342';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1342', '1', '2026-09-30', '1', '0','0134201','770','770','770','750','','0','0','0','0','0','0','0','0','0','0'); -- id=1342
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1342', '1', '0', '1', '2026-09-30'); -- id=1342
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1342', '1', '0', '0', '1342', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1389
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1342, 1,'2026-09-30 14:02:52',1)
                ON DUPLICATE KEY UPDATE productid = 1342, edited = 1, sysdate = '2026-09-30 14:02:52', userid = 1; -- id=2007
UPDATE product SET productName = 'فولكانو جينز 723', productDescription = '', productCatId = '28', productBuyPrice = '750.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01342',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '750',lastbuyprice_withDiscount = '750',meanbuyprice = '750',meanbuyprice_withDiscount = '750' , productbuypricereal = '750' , buypricereal_precentage = '0' , buytotal_precentage = '2.67' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='750',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='750',meanbuyprice_withTax='750',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1342';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('فولكانو جينز 722','','28','670','690','690','690','2026-09-30','0','1','0','','0','0','0','0','0','670','670','670','670','670','0','2.99','0','0','.','0','0','0','670','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','670','670','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','670','0','0','0','0','0','0','','','0','0','0','0'); -- id=1343
UPDATE product SET productName = 'فولكانو جينز 722', productDescription = '', productCatId = '28', productBuyPrice = '670', productSellAllPrice = '690', productSellUnitPrice = '690', productSellHalfPrice = '690', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01343',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '670',lastbuyprice_withDiscount = '670',meanbuyprice = '670',meanbuyprice_withDiscount = '670' , productbuypricereal = '670' , buypricereal_precentage = '0' , buytotal_precentage = '2.99' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='670',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='670',meanbuyprice_withTax='670',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='670',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1343';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1343', '1', '2026-09-30', '1', '0','0134301','690','690','690','670','','0','0','0','0','0','0','0','0','0','0'); -- id=1343
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1343', '1', '0', '1', '2026-09-30'); -- id=1343
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1343', '1', '0', '0', '1343', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1390
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1343, 1,'2026-09-30 14:02:52',1)
                ON DUPLICATE KEY UPDATE productid = 1343, edited = 1, sysdate = '2026-09-30 14:02:52', userid = 1; -- id=2008
UPDATE product SET productName = 'فولكانو جينز 722', productDescription = '', productCatId = '28', productBuyPrice = '670.00', productSellAllPrice = '690.00', productSellUnitPrice = '690.00', productSellHalfPrice = '690.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01343',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '670',lastbuyprice_withDiscount = '670',meanbuyprice = '670',meanbuyprice_withDiscount = '670' , productbuypricereal = '670' , buypricereal_precentage = '0' , buytotal_precentage = '2.99' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='670',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='670',meanbuyprice_withTax='670',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='670',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1343';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:32:54";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:02:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:02:54', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1053
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:33:12";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:03:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:03:12', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1054
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:34:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:04:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:04:03', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1055
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:35:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:05:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:05:02', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1056
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:35:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:05:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:05:40', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1057
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:36:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:06:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:06:23', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1058
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:37:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:07:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:07:20', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1059
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:38:37";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:08:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:08:37', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1060
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:42:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:12:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:12:33', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1061
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:42:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:12:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:12:39', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1062
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:48:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:18:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:18:00', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=1063
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('بلمن جلد 6136 فيلو','','31','485','505','505','505','2026-09-30','0','1','0','','0','0','0','0','0','485','485','485','485','485','0','4.12','0','0','.','0','0','0','485','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','485','485','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','485','0','0','0','0','0','0','','','0','0','0','0'); -- id=1344
UPDATE product SET productName = 'بلمن جلد 6136 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '485', productSellAllPrice = '505', productSellUnitPrice = '505', productSellHalfPrice = '505', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01344',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '485',lastbuyprice_withDiscount = '485',meanbuyprice = '485',meanbuyprice_withDiscount = '485' , productbuypricereal = '485' , buypricereal_precentage = '0' , buytotal_precentage = '4.12' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='485',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='485',meanbuyprice_withTax='485',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='485',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1344';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1344', '1', '2026-09-30', '1', '0','0134401','505','505','505','485','','0','0','0','0','0','0','0','0','0','0'); -- id=1344
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1344', '1', '0', '1', '2026-09-30'); -- id=1344
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1344', '1', '0', '0', '1344', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1391
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1344, 1,'2026-09-30 14:18:00',1)
                ON DUPLICATE KEY UPDATE productid = 1344, edited = 1, sysdate = '2026-09-30 14:18:00', userid = 1; -- id=2009
UPDATE product SET productName = 'بلمن جلد 6136 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '485.00', productSellAllPrice = '505.00', productSellUnitPrice = '505.00', productSellHalfPrice = '505.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01344',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '485',lastbuyprice_withDiscount = '485',meanbuyprice = '485',meanbuyprice_withDiscount = '485' , productbuypricereal = '485' , buypricereal_precentage = '0' , buytotal_precentage = '4.12' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='485',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='485',meanbuyprice_withTax='485',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='485',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1344';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('لامبورجيني 6144 فيلو','','31','570','590','590','590','2026-09-30','0','1','0','','0','0','0','0','0','570','570','570','570','570','0','3.51','0','0','.','0','0','0','570','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','570','570','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','570','0','0','0','0','0','0','','','0','0','0','0'); -- id=1345
UPDATE product SET productName = 'لامبورجيني 6144 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '570', productSellAllPrice = '590', productSellUnitPrice = '590', productSellHalfPrice = '590', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01345',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '570',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '570' , buypricereal_precentage = '0' , buytotal_precentage = '3.51' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='570',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='570',meanbuyprice_withTax='570',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='570',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1345';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1345', '1', '2026-09-30', '1', '0','0134501','590','590','590','570','','0','0','0','0','0','0','0','0','0','0'); -- id=1345
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1345', '1', '0', '1', '2026-09-30'); -- id=1345
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1345', '1', '0', '0', '1345', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1392
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1345, 1,'2026-09-30 14:18:00',1)
                ON DUPLICATE KEY UPDATE productid = 1345, edited = 1, sysdate = '2026-09-30 14:18:00', userid = 1; -- id=2010
UPDATE product SET productName = 'لامبورجيني 6144 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '570.00', productSellAllPrice = '590.00', productSellUnitPrice = '590.00', productSellHalfPrice = '590.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01345',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '570',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '570' , buypricereal_precentage = '0' , buytotal_precentage = '3.51' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='570',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='570',meanbuyprice_withTax='570',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='570',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1345';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('سيليكون تطريز 6156 فيلو','','31','535','555','555','555','2026-09-30','0','1','0','','0','0','0','0','0','535','535','535','535','535','0','3.74','3.74','0','.','0','0','0','535','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','535','535','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','535','0','0','0','0','0','0','','','0','0','0','0'); -- id=1346
UPDATE product SET productName = 'سيليكون تطريز 6156 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '535', productSellAllPrice = '555', productSellUnitPrice = '555', productSellHalfPrice = '555', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01346',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '535',lastbuyprice_withDiscount = '535',meanbuyprice = '535',meanbuyprice_withDiscount = '535' , productbuypricereal = '535' , buypricereal_precentage = '0' , buytotal_precentage = '3.74' , buyhalf_precentage = '3.74' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='535',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='535',meanbuyprice_withTax='535',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='535',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1346';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1346', '1', '2026-09-30', '1', '0','0134601','555','555','555','535','','0','0','0','0','0','0','0','0','0','0'); -- id=1346
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1346', '1', '0', '1', '2026-09-30'); -- id=1346
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1346', '1', '0', '0', '1346', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1393
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1346, 1,'2026-09-30 14:18:00',1)
                ON DUPLICATE KEY UPDATE productid = 1346, edited = 1, sysdate = '2026-09-30 14:18:00', userid = 1; -- id=2011
UPDATE product SET productName = 'سيليكون تطريز 6156 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '535.00', productSellAllPrice = '555.00', productSellUnitPrice = '555.00', productSellHalfPrice = '555.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01346',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '535',lastbuyprice_withDiscount = '535',meanbuyprice = '535',meanbuyprice_withDiscount = '535' , productbuypricereal = '535' , buypricereal_precentage = '0' , buytotal_precentage = '3.74' , buyhalf_precentage = '3.74' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='535',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='535',meanbuyprice_withTax='535',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='535',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1346';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('باجي فيت حزام 6157 فيلو','','31','475','595','595','595','2026-09-30','0','1','0','','0','0','0','0','0','475','475','475','475','475','0','25.26','0','0','.','0','0','0','475','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','475','475','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','475','0','0','0','0','0','0','','','0','0','0','0'); -- id=1347
UPDATE product SET productName = 'باجي فيت حزام 6157 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '475', productSellAllPrice = '595', productSellUnitPrice = '595', productSellHalfPrice = '595', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01347',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475',lastbuyprice_withDiscount = '475',meanbuyprice = '475',meanbuyprice_withDiscount = '475' , productbuypricereal = '475' , buypricereal_precentage = '0' , buytotal_precentage = '25.26' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='475',meanbuyprice_withTax='475',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='475',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1347';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1347', '1', '2026-09-30', '1', '0','0134701','595','595','595','475','','0','0','0','0','0','0','0','0','0','0'); -- id=1347
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1347', '1', '0', '1', '2026-09-30'); -- id=1347
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1347', '1', '0', '0', '1347', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1394
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1347, 1,'2026-09-30 14:18:00',1)
                ON DUPLICATE KEY UPDATE productid = 1347, edited = 1, sysdate = '2026-09-30 14:18:00', userid = 1; -- id=2012
UPDATE product SET productName = 'باجي فيت حزام 6157 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '475.00', productSellAllPrice = '595.00', productSellUnitPrice = '595.00', productSellHalfPrice = '595.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01347',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475',lastbuyprice_withDiscount = '475',meanbuyprice = '475',meanbuyprice_withDiscount = '475' , productbuypricereal = '475' , buypricereal_precentage = '0' , buytotal_precentage = '25.26' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='475',meanbuyprice_withTax='475',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='475',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1347';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('سيليكون ال في 6158 فيلو','','31','440','460','460','460','2026-09-30','0','1','0','','0','0','0','0','0','440','440','440','440','440','0','4.55','0','0','.','0','0','0','440','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','440','440','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','440','0','0','0','0','0','0','','','0','0','0','0'); -- id=1348
UPDATE product SET productName = 'سيليكون ال في 6158 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '440', productSellAllPrice = '460', productSellUnitPrice = '460', productSellHalfPrice = '460', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01348',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440',lastbuyprice_withDiscount = '440',meanbuyprice = '440',meanbuyprice_withDiscount = '440' , productbuypricereal = '440' , buypricereal_precentage = '0' , buytotal_precentage = '4.55' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1348';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1348', '1', '2026-09-30', '1', '0','0134801','460','460','460','440','','0','0','0','0','0','0','0','0','0','0'); -- id=1348
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1348', '1', '0', '1', '2026-09-30'); -- id=1348
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1348', '1', '0', '0', '1348', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1395
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1348, 1,'2026-09-30 14:18:00',1)
                ON DUPLICATE KEY UPDATE productid = 1348, edited = 1, sysdate = '2026-09-30 14:18:00', userid = 1; -- id=2013
UPDATE product SET productName = 'سيليكون ال في 6158 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '440.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01348',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440',lastbuyprice_withDiscount = '440',meanbuyprice = '440',meanbuyprice_withDiscount = '440' , productbuypricereal = '440' , buypricereal_precentage = '0' , buytotal_precentage = '4.55' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1348';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('سيليكون برادا 6159 فيلو','','31','440','460','460','460','2026-09-30','0','1','0','','0','0','0','0','0','440','440','440','440','440','0','4.55','0','0','.','0','0','0','440','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','440','440','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','440','0','0','0','0','0','0','','','0','0','0','0'); -- id=1349
UPDATE product SET productName = 'سيليكون برادا 6159 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '440', productSellAllPrice = '460', productSellUnitPrice = '460', productSellHalfPrice = '460', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01349',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440',lastbuyprice_withDiscount = '440',meanbuyprice = '440',meanbuyprice_withDiscount = '440' , productbuypricereal = '440' , buypricereal_precentage = '0' , buytotal_precentage = '4.55' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1349';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1349', '1', '2026-09-30', '1', '0','0134901','460','460','460','440','','0','0','0','0','0','0','0','0','0','0'); -- id=1349
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1349', '1', '0', '1', '2026-09-30'); -- id=1349
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1349', '1', '0', '0', '1349', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1396
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1349, 1,'2026-09-30 14:18:00',1)
                ON DUPLICATE KEY UPDATE productid = 1349, edited = 1, sysdate = '2026-09-30 14:18:00', userid = 1; -- id=2014
UPDATE product SET productName = 'سيليكون برادا 6159 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '440.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01349',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440',lastbuyprice_withDiscount = '440',meanbuyprice = '440',meanbuyprice_withDiscount = '440' , productbuypricereal = '440' , buypricereal_precentage = '0' , buytotal_precentage = '4.55' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1349';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('اميري تطريز 6161 فيلو','','31','555','575','575','575','2026-09-30','0','1','0','','0','0','0','0','0','555','555','555','555','555','0','3.6','0','0','.','0','0','0','555','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','555','555','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','555','0','0','0','0','0','0','','','0','0','0','0'); -- id=1350
UPDATE product SET productName = 'اميري تطريز 6161 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '555', productSellAllPrice = '575', productSellUnitPrice = '575', productSellHalfPrice = '575', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01350',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '555',lastbuyprice_withDiscount = '555',meanbuyprice = '555',meanbuyprice_withDiscount = '555' , productbuypricereal = '555' , buypricereal_precentage = '0' , buytotal_precentage = '3.6' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='555',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='555',meanbuyprice_withTax='555',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='555',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1350';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1350', '1', '2026-09-30', '1', '0','0135001','575','575','575','555','','0','0','0','0','0','0','0','0','0','0'); -- id=1350
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1350', '1', '0', '1', '2026-09-30'); -- id=1350
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1350', '1', '0', '0', '1350', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1397
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1350, 1,'2026-09-30 14:18:00',1)
                ON DUPLICATE KEY UPDATE productid = 1350, edited = 1, sysdate = '2026-09-30 14:18:00', userid = 1; -- id=2015
UPDATE product SET productName = 'اميري تطريز 6161 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '555.00', productSellAllPrice = '575.00', productSellUnitPrice = '575.00', productSellHalfPrice = '575.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01350',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '555',lastbuyprice_withDiscount = '555',meanbuyprice = '555',meanbuyprice_withDiscount = '555' , productbuypricereal = '555' , buypricereal_precentage = '0' , buytotal_precentage = '3.6' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='555',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='555',meanbuyprice_withTax='555',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='555',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1350';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('رمادي ميداليه 6164 فيلو','','31','440','460','460','460','2026-09-30','0','1','0','','0','0','0','0','0','440','440','440','440','440','0','4.55','0','0','.','0','0','0','440','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','440','440','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','440','0','0','0','0','0','0','','','0','0','0','0'); -- id=1351
UPDATE product SET productName = 'رمادي ميداليه 6164 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '440', productSellAllPrice = '460', productSellUnitPrice = '460', productSellHalfPrice = '460', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01351',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440',lastbuyprice_withDiscount = '440',meanbuyprice = '440',meanbuyprice_withDiscount = '440' , productbuypricereal = '440' , buypricereal_precentage = '0' , buytotal_precentage = '4.55' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1351';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1351', '1', '2026-09-30', '1', '0','0135101','460','460','460','440','','0','0','0','0','0','0','0','0','0','0'); -- id=1351
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1351', '1', '0', '1', '2026-09-30'); -- id=1351
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1351', '1', '0', '0', '1351', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1398
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1351, 1,'2026-09-30 14:18:00',1)
                ON DUPLICATE KEY UPDATE productid = 1351, edited = 1, sysdate = '2026-09-30 14:18:00', userid = 1; -- id=2016
UPDATE product SET productName = 'رمادي ميداليه 6164 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '440.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01351',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440',lastbuyprice_withDiscount = '440',meanbuyprice = '440',meanbuyprice_withDiscount = '440' , productbuypricereal = '440' , buypricereal_precentage = '0' , buytotal_precentage = '4.55' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1351';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('بانك 6169 فيلو','','31','615','635','635','635','2026-09-30','0','1','0','','0','0','0','0','0','615','615','615','615','615','0','3.25','0','0','.','0','0','0','615','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','615','615','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','615','0','0','0','0','0','0','','','0','0','0','0'); -- id=1352
UPDATE product SET productName = 'بانك 6169 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '615', productSellAllPrice = '635', productSellUnitPrice = '635', productSellHalfPrice = '635', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01352',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '615',lastbuyprice_withDiscount = '615',meanbuyprice = '615',meanbuyprice_withDiscount = '615' , productbuypricereal = '615' , buypricereal_precentage = '0' , buytotal_precentage = '3.25' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='615',meanbuyprice_withTax='615',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='615',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1352';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1352', '1', '2026-09-30', '1', '0','0135201','635','635','635','615','','0','0','0','0','0','0','0','0','0','0'); -- id=1352
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1352', '1', '0', '1', '2026-09-30'); -- id=1352
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1352', '1', '0', '0', '1352', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1399
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1352, 1,'2026-09-30 14:18:00',1)
                ON DUPLICATE KEY UPDATE productid = 1352, edited = 1, sysdate = '2026-09-30 14:18:00', userid = 1; -- id=2017
UPDATE product SET productName = 'بانك 6169 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '615.00', productSellAllPrice = '635.00', productSellUnitPrice = '635.00', productSellHalfPrice = '635.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01352',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '615',lastbuyprice_withDiscount = '615',meanbuyprice = '615',meanbuyprice_withDiscount = '615' , productbuypricereal = '615' , buypricereal_precentage = '0' , buytotal_precentage = '3.25' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='615',meanbuyprice_withTax='615',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='615',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1352';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('استراس 6171 فيلو','','31','600','620','620','620','2026-09-30','0','1','0','','0','0','0','0','0','600','600','600','600','600','0','3.33','0','0','.','0','0','0','600','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','600','600','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','600','0','0','0','0','0','0','','','0','0','0','0'); -- id=1353
UPDATE product SET productName = 'استراس 6171 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '600', productSellAllPrice = '620', productSellUnitPrice = '620', productSellHalfPrice = '620', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01353',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600' , buypricereal_precentage = '0' , buytotal_precentage = '3.33' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='600',meanbuyprice_withTax='600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1353';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1353', '1', '2026-09-30', '1', '0','0135301','620','620','620','600','','0','0','0','0','0','0','0','0','0','0'); -- id=1353
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1353', '1', '0', '1', '2026-09-30'); -- id=1353
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1353', '1', '0', '0', '1353', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1400
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1353, 1,'2026-09-30 14:18:00',1)
                ON DUPLICATE KEY UPDATE productid = 1353, edited = 1, sysdate = '2026-09-30 14:18:00', userid = 1; -- id=2018
UPDATE product SET productName = 'استراس 6171 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '600.00', productSellAllPrice = '620.00', productSellUnitPrice = '620.00', productSellHalfPrice = '620.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01353',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600' , buypricereal_precentage = '0' , buytotal_precentage = '3.33' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='600',meanbuyprice_withTax='600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1353';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:48:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:18:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:18:02', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1064
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:48:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:18:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:18:04', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1065
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:49:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:19:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:19:38', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1066
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:50:22";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:20:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:20:22', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1067
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:51:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:21:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:21:50', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1068
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:52:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:22:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:22:21', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1069
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:52:29";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:22:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:22:29', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1070
UPDATE productunit SET proUnitSellAllPrice  = 495.00 * productnumber  WHERE productid = 1347;
UPDATE product SET productName = 'باجي فيت حزام 6157 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '475.00', productSellAllPrice = '495.00', productSellUnitPrice = '595.00', productSellHalfPrice = '595.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01347',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475.00',lastbuyprice_withDiscount = '475',meanbuyprice = '475.00',meanbuyprice_withDiscount = '475' , productbuypricereal = '475.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.26' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',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='475',meanbuyprice_withTax='475',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='475',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1347';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1347, 1,'2026-09-30 14:22:36',1)
                ON DUPLICATE KEY UPDATE productid = 1347, edited = 1, sysdate = '2026-09-30 14:22:36', userid = 1; -- id=2012
UPDATE productunit SET proUnitSellHalfPrice = 595.00 * productnumber WHERE productid = 1347;
UPDATE product SET productName = 'باجي فيت حزام 6157 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '475.00', productSellAllPrice = '495.00', productSellUnitPrice = '595.00', productSellHalfPrice = '595.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01347',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475.00',lastbuyprice_withDiscount = '475',meanbuyprice = '475.00',meanbuyprice_withDiscount = '475' , productbuypricereal = '475.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.26' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',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='475',meanbuyprice_withTax='475',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='475',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1347';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1347, 1,'2026-09-30 14:22:36',1)
                ON DUPLICATE KEY UPDATE productid = 1347, edited = 1, sysdate = '2026-09-30 14:22:36', userid = 1; -- id=0
UPDATE productunit SET proUnitSellAllPrice  = 495.00 * productnumber  WHERE productid = 1347;
UPDATE product SET productName = 'باجي فيت حزام 6157 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '475.00', productSellAllPrice = '495.00', productSellUnitPrice = '595.00', productSellHalfPrice = '595.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01347',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475.00',lastbuyprice_withDiscount = '475',meanbuyprice = '475.00',meanbuyprice_withDiscount = '475' , productbuypricereal = '475.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.26' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',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='475',meanbuyprice_withTax='475',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='475',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1347';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1347, 1,'2026-09-30 14:22:39',1)
                ON DUPLICATE KEY UPDATE productid = 1347, edited = 1, sysdate = '2026-09-30 14:22:39', userid = 1; -- id=2012
UPDATE productunit SET proUnitSellHalfPrice = 495 * productnumber WHERE productid = 1347;
UPDATE product SET productName = 'باجي فيت حزام 6157 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '475.00', productSellAllPrice = '495.00', productSellUnitPrice = '595.00', productSellHalfPrice = '495', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01347',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475.00',lastbuyprice_withDiscount = '475',meanbuyprice = '475.00',meanbuyprice_withDiscount = '475' , productbuypricereal = '475.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.26' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',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='475',meanbuyprice_withTax='475',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='475',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1347';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1347, 1,'2026-09-30 14:22:41',1)
                ON DUPLICATE KEY UPDATE productid = 1347, edited = 1, sysdate = '2026-09-30 14:22:41', userid = 1; -- id=2012
UPDATE productunit SET proUnitSellUnitPrice = 495 * productnumber WHERE productid = 1347;
UPDATE product SET productName = 'باجي فيت حزام 6157 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '475.00', productSellAllPrice = '495.00', productSellUnitPrice = '495', productSellHalfPrice = '495.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01347',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475.00',lastbuyprice_withDiscount = '475',meanbuyprice = '475.00',meanbuyprice_withDiscount = '475' , productbuypricereal = '475.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.26' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='475',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='475',meanbuyprice_withTax='475',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='475',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1347';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1347, 1,'2026-09-30 14:22:44',1)
                ON DUPLICATE KEY UPDATE productid = 1347, edited = 1, sysdate = '2026-09-30 14:22:44', userid = 1; -- id=2012
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:52:44";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:22:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:22:44', '1', 'edit', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=edit&id=1347'); -- id=1071
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:53:19";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:23:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:23:19', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=update'); -- id=1072
BEGIN;
UPDATE product SET productName = 'باجي فيت حزام 6157 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '475', productSellAllPrice = '495', productSellUnitPrice = '495', productSellHalfPrice = '495', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01347',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '',lastbuyprice_withDiscount = '0',meanbuyprice = '',meanbuyprice_withDiscount = '0' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '25.26' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '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='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1347';
UPDATE product SET treeId = 0 WHERE productId = 1347;
UPDATE productunit SET  conditions = 1 WHERE productunitid = 1347;
UPDATE productunit SET unitid = '1', productid = '1347', productnumber = '1.00', productunitdate = '2026-09-30', userid = '1', conditions = '0',proUnitParcode='0134701',proUnitSellAllPrice='495',proUnitSellHalfPrice='495',proUnitSellUnitPrice ='495',proUnitBuyPrice='475',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1347';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1347, 1,'2026-09-30 14:23:19',1)
                ON DUPLICATE KEY UPDATE productid = 1347, edited = 1, sysdate = '2026-09-30 14:23:19', userid = 1; -- id=2012
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:53:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:23:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:23:20', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1073
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:53:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:23:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:23:23', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1074
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:53:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:23:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:23:56', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1075
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:54:29";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:24:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:24:29', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1076
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:55:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:25:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:25:23', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1077
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:55:58";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:25:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:25:58', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1078
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:56:32";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:26:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:26:32', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1079
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:57:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:27:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:27:03', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1080
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:57:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:27:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:27:38', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1081
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:57:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:27:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-30 14:27:42', '1', 'oneSupplier', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1082
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:57:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:27:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-30 14:27:50', '1', 'oneSupplier', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1083
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:57:52";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:27:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-30 14:27:52', '1', 'oneSupplier', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1084
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:58:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:28:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-30 14:28:00', '1', 'oneSupplier', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1085
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:58:52";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:28:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-09-30 14:28:52', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=1086
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:58:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:28:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 14:28:57', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=1087
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 10:59:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:29:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 14:29:09', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1088
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:00:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:30:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:30:11', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1089
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:03:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:33:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:33:47', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1090
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:03:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:33:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-30 14:33:56', '1', 'oneSupplier', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1091
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:04:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:34:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-30 14:34:07', '1', 'oneSupplier', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1092
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:04:41";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:34:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-09-30 14:34:41', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=1093
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:04:44";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:34:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 14:34:44', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=1094
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:05:01";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:35:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 14:35:01', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1095
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:05:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:35:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:35:39', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1096
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:06:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:36:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 14:36:18', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1097
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:06:18";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-09-30 14:36:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 14:36:18', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1098
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:06:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:36:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 14:36:20', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1099
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:08:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:38:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 14:38:55', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1100
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:09:59";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:39:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyreport.php', '2026-09-30 14:39:59', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyreport.php'); -- id=1101
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:10:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:40:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 14:40:03', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1102
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:11:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:41:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 14:41:42', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add&return_url=1&billnameid=1'); -- id=1103
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 ('06abcf5132e8cf', '2026-09-30 14:40:03', '20', '546030.00', '628205', '0', '0', '82175.00',  '82175.00', '0', '82175', '1', '2026-09-30 14:41:42', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=5
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 ('01338', '5', '28', '1338', '15', '700', '10500.00', '0', '', '2026-09-30 14:41:42', '1338','','','0','0','0','0','0',null,'700','10500','0','0','0','0','0','0','0','0','1'); -- id=13
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:40:03', 1, 1338, 0, 0
                    , 700, 15, 0, 0, 1, '2026-09-30 14:41:42')
                ON DUPLICATE KEY UPDATE buyprice = 700,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:41:42' ; -- id=18
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1338', '700', '15', '0', 'buyBillController.php', '13', '', '0', '0'); -- id=8
UPDATE product SET  productBuyPrice = "700" WHERE productId = 1338 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 13 ;
UPDATE product SET productName = 'فولكانو جينز 721', productDescription = '', productCatId = '28', productBuyPrice = '700.00', productSellAllPrice = '720.00', productSellUnitPrice = '720.00', productSellHalfPrice = '720.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01338',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '700',lastbuyprice_withDiscount = '700',meanbuyprice = '700',meanbuyprice_withDiscount = '700' , productbuypricereal = '700.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.86' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='700',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='700',meanbuyprice_withTax='700',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='700',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1338';
UPDATE buybilldetail SET  lastbuyprice = 700 , meanbuyprice = 700, lastbuyprice_withDiscount = 700, meanbuyprice_withDiscount = 700
        , lastbuyprice_withTax = 700, meanbuyprice_withTax = 700, lastbuyprice_withDiscountAndTax = 700
                where buybilldetailid = 13;
UPDATE productunit SET proUnitBuyPrice  = 700 * productnumber WHERE productid = 1338;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1338';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1338', '1', '15', '0', '5', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '1', '2026-09-30 14:40:03','0','0'); -- id=1401
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 ('01339', '5', '28', '1339', '30', '430', '12900.00', '0', '', '2026-09-30 14:41:42', '1339','','','0','0','0','0','0',null,'430','12900','0','0','0','0','0','0','0','0','1'); -- id=14
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:40:03', 1, 1339, 0, 0
                    , 430, 30, 0, 0, 1, '2026-09-30 14:41:42')
                ON DUPLICATE KEY UPDATE buyprice = 430,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:41:42' ; -- id=19
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1339', '430', '30', '0', 'buyBillController.php', '14', '', '0', '0'); -- id=9
UPDATE product SET  productBuyPrice = "430" WHERE productId = 1339 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 14 ;
UPDATE product SET productName = 'فولكانو جينز 1250', productDescription = '', productCatId = '28', productBuyPrice = '430.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01339',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430',lastbuyprice_withDiscount = '430',meanbuyprice = '430',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.65' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',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='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1339';
UPDATE buybilldetail SET  lastbuyprice = 430 , meanbuyprice = 430, lastbuyprice_withDiscount = 430, meanbuyprice_withDiscount = 430
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where buybilldetailid = 14;
UPDATE productunit SET proUnitBuyPrice  = 430 * productnumber WHERE productid = 1339;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1339';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1339', '1', '30', '0', '5', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-09-30 14:40:03','0','0'); -- id=1402
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 ('01340', '5', '28', '1340', '15', '630', '9450.00', '0', '', '2026-09-30 14:41:42', '1340','','','0','0','0','0','0',null,'630','9450','0','0','0','0','0','0','0','0','1'); -- id=15
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:40:03', 1, 1340, 0, 0
                    , 630, 15, 0, 0, 1, '2026-09-30 14:41:42')
                ON DUPLICATE KEY UPDATE buyprice = 630,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:41:42' ; -- id=20
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1340', '630', '15', '0', 'buyBillController.php', '15', '', '0', '0'); -- id=10
UPDATE product SET  productBuyPrice = "630" WHERE productId = 1340 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 15 ;
UPDATE product SET productName = 'فولكانو جينز 720', productDescription = '', productCatId = '28', productBuyPrice = '630.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01340',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630',lastbuyprice_withDiscount = '630',meanbuyprice = '630',meanbuyprice_withDiscount = '630' , productbuypricereal = '630.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.17' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='630',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='630',meanbuyprice_withTax='630',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='630',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1340';
UPDATE buybilldetail SET  lastbuyprice = 630 , meanbuyprice = 630, lastbuyprice_withDiscount = 630, meanbuyprice_withDiscount = 630
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 630, lastbuyprice_withDiscountAndTax = 630
                where buybilldetailid = 15;
UPDATE productunit SET proUnitBuyPrice  = 630 * productnumber WHERE productid = 1340;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1340';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1340', '1', '15', '0', '5', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '1', '2026-09-30 14:40:03','0','0'); -- id=1403
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 ('01341', '5', '28', '1341', '15', '625', '9375.00', '0', '', '2026-09-30 14:41:42', '1341','','','0','0','0','0','0',null,'625','9375','0','0','0','0','0','0','0','0','1'); -- id=16
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:40:03', 1, 1341, 0, 0
                    , 625, 15, 0, 0, 1, '2026-09-30 14:41:42')
                ON DUPLICATE KEY UPDATE buyprice = 625,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:41:42' ; -- id=21
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1341', '625', '15', '0', 'buyBillController.php', '16', '', '0', '0'); -- id=11
UPDATE product SET  productBuyPrice = "625" WHERE productId = 1341 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 16 ;
UPDATE product SET productName = 'فولكانو جينز 719', productDescription = '', productCatId = '28', productBuyPrice = '625.00', productSellAllPrice = '645.00', productSellUnitPrice = '645.00', productSellHalfPrice = '645.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01341',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '625',lastbuyprice_withDiscount = '625',meanbuyprice = '625',meanbuyprice_withDiscount = '625' , productbuypricereal = '625.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.20' , buyhalf_precentage = '3.20' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='625',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='625',meanbuyprice_withTax='625',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='625',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1341';
UPDATE buybilldetail SET  lastbuyprice = 625 , meanbuyprice = 625, lastbuyprice_withDiscount = 625, meanbuyprice_withDiscount = 625
        , lastbuyprice_withTax = 625, meanbuyprice_withTax = 625, lastbuyprice_withDiscountAndTax = 625
                where buybilldetailid = 16;
UPDATE productunit SET proUnitBuyPrice  = 625 * productnumber WHERE productid = 1341;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1341';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1341', '1', '15', '0', '5', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '1', '2026-09-30 14:40:03','0','0'); -- id=1404
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 ('01342', '5', '28', '1342', '15', '750', '11250.00', '0', '', '2026-09-30 14:41:42', '1342','','','0','0','0','0','0',null,'750','11250','0','0','0','0','0','0','0','0','1'); -- id=17
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:40:03', 1, 1342, 0, 0
                    , 750, 15, 0, 0, 1, '2026-09-30 14:41:42')
                ON DUPLICATE KEY UPDATE buyprice = 750,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:41:42' ; -- id=22
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1342', '750', '15', '0', 'buyBillController.php', '17', '', '0', '0'); -- id=12
UPDATE product SET  productBuyPrice = "750" WHERE productId = 1342 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 17 ;
UPDATE product SET productName = 'فولكانو جينز 723', productDescription = '', productCatId = '28', productBuyPrice = '750.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01342',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '750',lastbuyprice_withDiscount = '750',meanbuyprice = '750',meanbuyprice_withDiscount = '750' , productbuypricereal = '750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.67' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='750',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='750',meanbuyprice_withTax='750',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1342';
UPDATE buybilldetail SET  lastbuyprice = 750 , meanbuyprice = 750, lastbuyprice_withDiscount = 750, meanbuyprice_withDiscount = 750
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 750, lastbuyprice_withDiscountAndTax = 750
                where buybilldetailid = 17;
UPDATE productunit SET proUnitBuyPrice  = 750 * productnumber WHERE productid = 1342;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1342';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1342', '1', '15', '0', '5', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '1', '2026-09-30 14:40:03','0','0'); -- id=1405
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 ('01343', '5', '28', '1343', '20', '670', '13400.00', '0', '', '2026-09-30 14:41:42', '1343','','','0','0','0','0','0',null,'670','13400','0','0','0','0','0','0','0','0','1'); -- id=18
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:40:03', 1, 1343, 0, 0
                    , 670, 20, 0, 0, 1, '2026-09-30 14:41:42')
                ON DUPLICATE KEY UPDATE buyprice = 670,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:41:42' ; -- id=23
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1343', '670', '20', '0', 'buyBillController.php', '18', '', '0', '0'); -- id=13
UPDATE product SET  productBuyPrice = "670" WHERE productId = 1343 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 18 ;
UPDATE product SET productName = 'فولكانو جينز 722', productDescription = '', productCatId = '28', productBuyPrice = '670.00', productSellAllPrice = '690.00', productSellUnitPrice = '690.00', productSellHalfPrice = '690.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01343',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '670',lastbuyprice_withDiscount = '670',meanbuyprice = '670',meanbuyprice_withDiscount = '670' , productbuypricereal = '670.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.99' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='670',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='670',meanbuyprice_withTax='670',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='670',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1343';
UPDATE buybilldetail SET  lastbuyprice = 670 , meanbuyprice = 670, lastbuyprice_withDiscount = 670, meanbuyprice_withDiscount = 670
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where buybilldetailid = 18;
UPDATE productunit SET proUnitBuyPrice  = 670 * productnumber WHERE productid = 1343;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1343';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1343', '1', '20', '0', '5', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-09-30 14:40:03','0','0'); -- id=1406
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 ('09724', '5', '28', '945', '30', '510', '15300.00', '0', '', '2026-09-30 14:41:42', '945','','','0','0','0','0','0',null,'510','15300','0','0','0','0','0','0','0','0','1'); -- id=19
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:40:03', 1, 945, 0, 0
                    , 510, 30, 0, 0, 1, '2026-09-30 14:41:42')
                ON DUPLICATE KEY UPDATE buyprice = 510,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:41:42' ; -- id=24
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('945', '510', '30', '0', 'buyBillController.php', '19', '', '0', '0'); -- id=14
UPDATE product SET  productBuyPrice = "510" WHERE productId = 945 ;
UPDATE buybilldetail SET  quantitybefore = 5 WHERE buybilldetailid = 19 ;
UPDATE product SET productName = 'فولكانو جينز 1214', productDescription = '', productCatId = '28', productBuyPrice = '510.00', productSellAllPrice = '530.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09724',type ='0', expireDate = '0' , dailyentryId = '300',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '510',meanbuyprice = '510',meanbuyprice_withDiscount = '510' , productbuypricereal = '510.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='510',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9724',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='510',meanbuyprice_withTax='510',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='1',lastbuyprice_withDiscountAndTax='510',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='1',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '945';
UPDATE buybilldetail SET  lastbuyprice = 510 , meanbuyprice = 510, lastbuyprice_withDiscount = 510, meanbuyprice_withDiscount = 510
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 510
                where buybilldetailid = 19;
UPDATE productunit SET proUnitBuyPrice  = 510 * productnumber WHERE productid = 945;
UPDATE storedetail SET  productquantity = '35', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '945';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('945', '1', '30', '0', '5', 'اضافة فاتورة مشتريات', 'buyBillController.php', '5', '35', '1', '2026-09-30 14:40:03','0','0'); -- id=1407
UPDATE supplier SET  suppliercurrentDebt = '420530',suppliercurrentDebtInCurrency= '628205' , userid = '1', supplierdate = '2026-09-30 14:41:42'   WHERE supplierid = '20';
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 ('20', '338355.00', '82175', '0', 'اضافة فاتورة مشتريات', '5', '420530', '2026-09-30 14:40:03', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','82175','1','546030','82175','628205','0',''); -- id=82
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '82175', '82175', '2026-09-30', '1', '0', '0', '2026-09-30 14:41:42','اضافة فاتورة مشتريات رقم 5','1','0',null,'0','5','buyBillController.php?do=details&id=5'); -- id=799
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('799', '382', '82175', '','0'); -- id=800
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12376875', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('799', '439', '82175', '','0'); -- id=799
UPDATE accountstree SET name = 'فولكانو جينز - مورد', customName = 'فولكانو جينز - مورد', customNameEn = 'فولكانو جينز - مورد', nameEn = 'فولكانو جينز - مورد', parent = '81', accountNature = '1', theValue = '82175', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 13:17:33' WHERE id = '439';
update buybill set dailyentryid='799,0' where buybillid=5;
COMMIT;
UPDATE product SET overAllAveragePrice = 510 WHERE productId = 945;UPDATE product SET overAllAveragePrice = 700 WHERE productId = 1338;UPDATE product SET overAllAveragePrice = 430 WHERE productId = 1339;UPDATE product SET overAllAveragePrice = 630 WHERE productId = 1340;UPDATE product SET overAllAveragePrice = 625 WHERE productId = 1341;UPDATE product SET overAllAveragePrice = 750 WHERE productId = 1342;UPDATE product SET overAllAveragePrice = 670 WHERE productId = 1343;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:11:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:41:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 14:41:43', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1104
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:11:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:41:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 14:41:45', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1105

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abcf4349a5a7
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 14:41:45', '06abcf4349a5a7', '1', '0.00', '0', '0', '1', '6100.00', '6100', '6100', '0', '1', '2026-09-30 14:41:45', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '10' ,'0','','','','','-1','0','0','0','0','0','6100','0','','0','0','6100','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-30','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=15
UPDATE client SET  clientdebt = '0', userid = '2' 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','اضافة فاتورة مبيعات','15', '0', '2026-09-30 14:41:45', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '6100', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 14:41:45','0','0','',''); -- id=23
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 19;
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 ('430','01339', '15', '28', '1339', '5', '450', '2250', '0', '', '0', '2026-09-30 14:41:45', '1339', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','19-5,','1','1','0','0','450','2250','0','','0','0.00','0','0','0','0'); -- id=24
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 24;
 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 (1339, '2026-09-30', 2250, 2150, 2150
                    , 2150, 2150, 2150, 2150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2150, 2150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2250, sellCostBuyPrice =sellCostBuyPrice+2150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2250, 2150, 2150
                    , 2150, 2150, 2150, 2150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2150, 2150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2250, sellCostBuyPrice =sellCostBuyPrice+2150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2150
                        , returnSellVal = returnSellVal+0, 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 = '25', userid = '2', storedetaildate = '2026-09-30 14:41:45' WHERE storedetailid = '1339';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1339', '1', '5', '1', '15', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '25', '2', '2026-09-30 14:41:45','0','0'); -- id=1408
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 22;
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 ('750','01342', '15', '28', '1342', '5', '770', '3850', '0', '', '0', '2026-09-30 14:41:45', '1342', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','22-5,','1','1','0','0','770','3850','0','','0','0.00','0','0','0','0'); -- id=25
UPDATE sellbilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 750.00, meanbuyprice_withDiscount = 750.00
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 750, lastbuyprice_withDiscountAndTax = 750
                where sellbilldetailid = 25;
 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 (1342, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, 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 = '2', storedetaildate = '2026-09-30 14:41:45' WHERE storedetailid = '1342';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1342', '1', '5', '1', '15', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-09-30 14:41:45','0','0'); -- id=1409
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '43035',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('36935','6100', '0', '2', 'اضافة فاتورة مبيعات', '15', '43035', '2026-09-30 14:41:45', '2',  'sellbillController.php','1','','0'); -- id=26
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6100', '6100', '2026-09-30', '2', '0', '0', '2026-09-30 14:41:45','اضافة فاتورة مبيعات رقم 15','1','0',null,'0','15','sellbillController.php?do=showDetail&sellbillid=15'); -- id=800
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('800', '419', '6100', '','0'); -- id=801
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '43035', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('800', '143', '6100', '','0'); -- id=800
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '63285', 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 ( '5900', '5900', '2026-09-30', '2', '0', '0', '2026-09-30 14:41:45','اضافة فاتورة مبيعات رقم 15 - صرف البضاعة من المخزن','1','0',null,'0','15','sellbillController.php?do=showDetail&sellbillid=15'); -- id=801
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('801', '402', '5900', '','0'); -- id=802
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '68790', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('801', '382', '5900', '','0'); -- id=801
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12370975', 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='800,0,801' where sellbillid=15;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 6100, 5900, 5900
                    , 5900, 5900, 5900, 5900
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5900, 5900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6100, sellCostBuyPrice =sellCostBuyPrice+5900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6100, 5900, 5900
                    , 5900, 5900, 5900, 5900
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5900, 5900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6100, sellCostBuyPrice =sellCostBuyPrice+5900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5900
                        , returnSellVal = returnSellVal+0, 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, 6100, 5900, 5900
                    , 5900, 5900, 5900, 5900, 5900, 5900)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+6100, netSellCostBuyPrice = netSellCostBuyPrice+5900
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+5900
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+5900
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5900
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+5900
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+5900
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+5900
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5900;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abcf4349a5a7 and sellbillId = 15 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:11:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:41:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 14:41:45', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1106
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:12:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:42:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 14:42:02', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=1107
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:13:14";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:43:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 14:43:14', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1108

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abcf58aa4817
-- ----------------------------------------------------------------------------------------------------

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 ('2026-09-30 14:43:14', '06abcf58aa4817', '1', '0.00', '0', '0', '1', '2125', '2125', '-2125', '0', '1', '2026-09-30 14:43:14', '', '2', '0', 'نقدي','2', '0', '5', '0', 'نقدي', '5', '0', '', '','','','-1','0','0','0','','0','-2125','0','0','0','0','0','0','0','0','-1','0','0','1','','0'); -- id=2
UPDATE client SET  clientdebt = '0', userid = '2' 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','اضافة فاتورة مردوات مبيعات','2', '0', '2026-09-30 14:43:14', '2', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '2125', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 14:43:14','0','0','',''); -- id=24
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 ('405.00', '90202', '2', '28', '928', '5', '425', '2125', '0', '', '0', '0', '928', '0.00', '0','1','0','','','0','0','0','0','0','0','1','1','','0','0','425','2125','0','','0'); -- id=2
UPDATE returnsellbilldetail SET  lastbuyprice = 405.00 , meanbuyprice = 405.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 405.00
        , lastbuyprice_withTax = 405, meanbuyprice_withTax = 405, lastbuyprice_withDiscountAndTax = 405
                where returnsellbilldetailid = 2;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (928, '2026-09-30', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2125, 2025, 2025, 2025
                    , 2025, 2025, 2025, 0, 5, 0, 0, 2025, 2025)
                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+2125, returnSellCostBuyPrice = returnSellCostBuyPrice+2025, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2025
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2025, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2025
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2025
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2025
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2025
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2025
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+5;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2125, 2025, 2025, 2025
                    , 2025, 2025, 2025, 0, 0, 2025, 2025)
                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+2125, returnSellCostBuyPrice = returnSellCostBuyPrice+2025, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2025
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2025, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2025
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2025
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2025
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2025
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2025;
UPDATE storedetail SET  productquantity = '61', userid = '2', storedetaildate = '2026-09-30 14:43:14' WHERE storedetailid = '928';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('928', '1', '5', '0', '2', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '56', '61', '2', '2026-09-30 14:43:14','0','0'); -- id=1410
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '40910',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('43035','-2125', '1', '2', 'اضافة فاتورة مردوات مبيعات', '2', '40910', '2026-09-30 14:43:14', '2',  'returnsellbillController.php','1','','0'); -- id=27
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2125', '2125', '2026-09-30', '2', '0', '0', '2026-09-30 14:43:14','اضافة فاتورة مردود مبيعات رقم 2','1','0',null,'0','2','returnsellbillController.php?do=showDetail&returnsellbillid=2'); -- id=802
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('802', '143', '2125', '','0'); -- id=803
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '61160', 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 ('802', '419', '2125', '','0'); -- id=802
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '40910', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2025', '2025', '2026-09-30', '2', '0', '0', '2026-09-30 14:43:14','اضافة فاتورة مردود مبيعات رقم 2 - صرف البضاعة من المخزن','1','0',null,'0','2','returnsellbillController.php?do=showDetail&returnsellbillid=2'); -- id=803
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('803', '382', '2025', '','0'); -- id=804
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12373000', 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 ('803', '402', '2025', '','0'); -- id=803
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '66765', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
update returnsellbill set dailyentryid='802,0,803' where returnsellbillid=2;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2125, 2025, 2025, 2025
                    , 2025, 2025, 2025 ,0, 0, 2025, 2025)
                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+2125, returnSellCostBuyPrice = returnSellCostBuyPrice+2025, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2025
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2025, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2025
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2025
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2025
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2025
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2025;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2125, 2025, 2025, 2025
                    , 2025, 2025, 2025 ,0, 0, 2025, 2025)
                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+2125, returnSellCostBuyPrice = returnSellCostBuyPrice+2025, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2025
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2025, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2025
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2025
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2025
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2025
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2025;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -2125, -2025, -2025
                    , -2025, -2025, -2025, -2025, -2025, -2025)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-2125, netSellCostBuyPrice = netSellCostBuyPrice+-2025
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-2025
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-2025
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-2025
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-2025
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-2025
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-2025
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-2025;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abcf58aa4817 and sellbillId = 2 and returnsellbillId = 2
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:13:15";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:43:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 14:43:15', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=1109
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:14:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:44:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 14:44:02', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add&return_url=1&billnameid=1'); -- id=1110
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 ('06abcf5773f1cb', '2026-09-30 14:41:43', '26', '546030.00', '622040', '1040', '0', '77050.00',  '76010.00', '0', '76010', '1', '2026-09-30 14:44:02', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=6
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 ('01331', '6', '8', '1331', '20', '600', '12000.00', '0', '', '2026-09-30 14:44:02', '1331','','','0','0','0','0','0',null,'600','12000','0','0','0','0','0','0','0','0','1'); -- id=20
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:41:43', 1, 1331, 0, 0
                    , 591.9, 20, 0, 0, 1, '2026-09-30 14:44:02')
                ON DUPLICATE KEY UPDATE buyprice = 591.9,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:44:02' ; -- id=25
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1331', '600', '20', '0', 'buyBillController.php', '20', '', '0', '0'); -- id=15
UPDATE product SET  productBuyPrice = "600" WHERE productId = 1331 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 20 ;
UPDATE product SET productName = 'الدولي جينز 608', productDescription = '', productCatId = '8', productBuyPrice = '600.00', productSellAllPrice = '620.00', productSellUnitPrice = '620.00', productSellHalfPrice = '620.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01331',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '591.9',meanbuyprice = '600',meanbuyprice_withDiscount = '591.9' , productbuypricereal = '600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.33' , buyhalf_precentage = '3.33' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',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='600',meanbuyprice_withTax='600',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='591.9',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1331';
UPDATE buybilldetail SET  lastbuyprice = 600 , meanbuyprice = 600, lastbuyprice_withDiscount = 591.9, meanbuyprice_withDiscount = 591.9
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 591.9
                where buybilldetailid = 20;
UPDATE productunit SET proUnitBuyPrice  = 600 * productnumber WHERE productid = 1331;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1331';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1331', '1', '20', '0', '6', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-09-30 14:41:43','0','0'); -- id=1411
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('01332', '6', '8', '1332', '15', '650', '9750.00', '0', '', '2026-09-30 14:44:02', '1332','','','0','0','0','0','0',null,'650','9750','0','0','0','0','0','0','0','0','1'); -- id=21
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:41:43', 1, 1332, 0, 0
                    , 641.23, 15, 0, 0, 1, '2026-09-30 14:44:02')
                ON DUPLICATE KEY UPDATE buyprice = 641.23,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:44:02' ; -- id=26
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1332', '650', '15', '0', 'buyBillController.php', '21', '', '0', '0'); -- id=16
UPDATE product SET  productBuyPrice = "650" WHERE productId = 1332 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 21 ;
UPDATE product SET productName = 'الدولي جينز 607', productDescription = '', productCatId = '8', productBuyPrice = '650.00', productSellAllPrice = '670.00', productSellUnitPrice = '670.00', productSellHalfPrice = '670.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01332',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '641.23',meanbuyprice = '650',meanbuyprice_withDiscount = '641.23' , productbuypricereal = '650.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.08' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='650',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='650',meanbuyprice_withTax='650',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='641.23',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1332';
UPDATE buybilldetail SET  lastbuyprice = 650 , meanbuyprice = 650, lastbuyprice_withDiscount = 641.23, meanbuyprice_withDiscount = 641.23
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 650, lastbuyprice_withDiscountAndTax = 641.23
                where buybilldetailid = 21;
UPDATE productunit SET proUnitBuyPrice  = 650 * productnumber WHERE productid = 1332;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1332';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1332', '1', '15', '0', '6', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '1', '2026-09-30 14:41:43','0','0'); -- id=1412
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('01333', '6', '8', '1333', '20', '510', '10200.00', '0', '', '2026-09-30 14:44:02', '1333','','','0','0','0','0','0',null,'510','10200','0','0','0','0','0','0','0','0','1'); -- id=22
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:41:43', 1, 1333, 0, 0
                    , 503.12, 20, 0, 0, 1, '2026-09-30 14:44:02')
                ON DUPLICATE KEY UPDATE buyprice = 503.12,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:44:02' ; -- id=27
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1333', '510', '20', '0', 'buyBillController.php', '22', '', '0', '0'); -- id=17
UPDATE product SET  productBuyPrice = "510" WHERE productId = 1333 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 22 ;
UPDATE product SET productName = 'الدولي جينز 606', productDescription = '', productCatId = '8', productBuyPrice = '510.00', productSellAllPrice = '530.00', productSellUnitPrice = '530.00', productSellHalfPrice = '530.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01333',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '503.12',meanbuyprice = '510',meanbuyprice_withDiscount = '503.12' , productbuypricereal = '510.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.92' , buyhalf_precentage = '3.92' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='510',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='510',meanbuyprice_withTax='510',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='503.12',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1333';
UPDATE buybilldetail SET  lastbuyprice = 510 , meanbuyprice = 510, lastbuyprice_withDiscount = 503.12, meanbuyprice_withDiscount = 503.12
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 503.12
                where buybilldetailid = 22;
UPDATE productunit SET proUnitBuyPrice  = 510 * productnumber WHERE productid = 1333;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1333';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1333', '1', '20', '0', '6', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-09-30 14:41:43','0','0'); -- id=1413
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 ('01334', '6', '8', '1334', '10', '565', '5650.00', '0', '', '2026-09-30 14:44:02', '1334','','','0','0','0','0','0',null,'565','5650','0','0','0','0','0','0','0','0','1'); -- id=23
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:41:43', 1, 1334, 0, 0
                    , 557.37, 10, 0, 0, 1, '2026-09-30 14:44:02')
                ON DUPLICATE KEY UPDATE buyprice = 557.37,
                        buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:44:02' ; -- id=28
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1334', '565', '10', '0', 'buyBillController.php', '23', '', '0', '0'); -- id=18
UPDATE product SET  productBuyPrice = "565" WHERE productId = 1334 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 23 ;
UPDATE product SET productName = 'الدولي جينز 558', productDescription = '', productCatId = '8', productBuyPrice = '565.00', productSellAllPrice = '585.00', productSellUnitPrice = '585.00', productSellHalfPrice = '585.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01334',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '565',lastbuyprice_withDiscount = '557.37',meanbuyprice = '565',meanbuyprice_withDiscount = '557.37' , productbuypricereal = '565.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.54' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='565',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='565',meanbuyprice_withTax='565',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='557.37',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1334';
UPDATE buybilldetail SET  lastbuyprice = 565 , meanbuyprice = 565, lastbuyprice_withDiscount = 557.37, meanbuyprice_withDiscount = 557.37
        , lastbuyprice_withTax = 565, meanbuyprice_withTax = 565, lastbuyprice_withDiscountAndTax = 557.37
                where buybilldetailid = 23;
UPDATE productunit SET proUnitBuyPrice  = 565 * productnumber WHERE productid = 1334;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1334';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1334', '1', '10', '0', '6', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '10', '1', '2026-09-30 14:41:43','0','0'); -- id=1414
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 ('01335', '6', '8', '1335', '15', '630', '9450.00', '0', '', '2026-09-30 14:44:02', '1335','','','0','0','0','0','0',null,'630','9450','0','0','0','0','0','0','0','0','1'); -- id=24
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:41:43', 1, 1335, 0, 0
                    , 621.5, 15, 0, 0, 1, '2026-09-30 14:44:02')
                ON DUPLICATE KEY UPDATE buyprice = 621.5,
                        buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:44:02' ; -- id=29
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1335', '630', '15', '0', 'buyBillController.php', '24', '', '0', '0'); -- id=19
UPDATE product SET  productBuyPrice = "630" WHERE productId = 1335 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 24 ;
UPDATE product SET productName = 'الدولي جينز 605', productDescription = '', productCatId = '8', productBuyPrice = '630.00', productSellAllPrice = '650.00', productSellUnitPrice = '650.00', productSellHalfPrice = '650.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01335',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '630',lastbuyprice_withDiscount = '621.5',meanbuyprice = '630',meanbuyprice_withDiscount = '621.5' , productbuypricereal = '630.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.17' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='630',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='630',meanbuyprice_withTax='630',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='621.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1335';
UPDATE buybilldetail SET  lastbuyprice = 630 , meanbuyprice = 630, lastbuyprice_withDiscount = 621.5, meanbuyprice_withDiscount = 621.5
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 630, lastbuyprice_withDiscountAndTax = 621.5
                where buybilldetailid = 24;
UPDATE productunit SET proUnitBuyPrice  = 630 * productnumber WHERE productid = 1335;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1335';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1335', '1', '15', '0', '6', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '15', '1', '2026-09-30 14:41:43','0','0'); -- id=1415
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 ('01336', '6', '8', '1336', '25', '545', '13625.00', '0', '', '2026-09-30 14:44:02', '1336','','','0','0','0','0','0',null,'545','13625','0','0','0','0','0','0','0','0','1'); -- id=25
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:41:43', 1, 1336, 0, 0
                    , 537.64, 25, 0, 0, 1, '2026-09-30 14:44:02')
                ON DUPLICATE KEY UPDATE buyprice = 537.64,
                        buyQuantity =buyQuantity+25, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:44:02' ; -- id=30
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1336', '545', '25', '0', 'buyBillController.php', '25', '', '0', '0'); -- id=20
UPDATE product SET  productBuyPrice = "545" WHERE productId = 1336 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 25 ;
UPDATE product SET productName = 'الدولي جينز 609', productDescription = '', productCatId = '8', productBuyPrice = '545.00', productSellAllPrice = '565.00', productSellUnitPrice = '565.00', productSellHalfPrice = '565.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01336',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '545',lastbuyprice_withDiscount = '537.64',meanbuyprice = '545',meanbuyprice_withDiscount = '537.64' , productbuypricereal = '545.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.67' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='545',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='545',meanbuyprice_withTax='545',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='537.64',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1336';
UPDATE buybilldetail SET  lastbuyprice = 545 , meanbuyprice = 545, lastbuyprice_withDiscount = 537.64, meanbuyprice_withDiscount = 537.64
        , lastbuyprice_withTax = 545, meanbuyprice_withTax = 545, lastbuyprice_withDiscountAndTax = 537.64
                where buybilldetailid = 25;
UPDATE productunit SET proUnitBuyPrice  = 545 * productnumber WHERE productid = 1336;
UPDATE storedetail SET  productquantity = '25', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1336';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1336', '1', '25', '0', '6', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '25', '1', '2026-09-30 14:41:43','0','0'); -- id=1416
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 ('01337', '6', '8', '1337', '25', '655', '16375.00', '0', '', '2026-09-30 14:44:02', '1337','','','0','0','0','0','0',null,'655','16375','0','0','0','0','0','0','0','0','1'); -- id=26
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:41:43', 1, 1337, 0, 0
                    , 646.16, 25, 0, 0, 1, '2026-09-30 14:44:02')
                ON DUPLICATE KEY UPDATE buyprice = 646.16,
                        buyQuantity =buyQuantity+25, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:44:02' ; -- id=31
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1337', '655', '25', '0', 'buyBillController.php', '26', '', '0', '0'); -- id=21
UPDATE product SET  productBuyPrice = "655" WHERE productId = 1337 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 26 ;
UPDATE product SET productName = 'الدولي جينز 610', productDescription = '', productCatId = '8', productBuyPrice = '655.00', productSellAllPrice = '685.00', productSellUnitPrice = '685.00', productSellHalfPrice = '685.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01337',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '655',lastbuyprice_withDiscount = '646.16',meanbuyprice = '655',meanbuyprice_withDiscount = '646.16' , productbuypricereal = '655.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.58' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='655',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='655',meanbuyprice_withTax='655',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='646.16',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1337';
UPDATE buybilldetail SET  lastbuyprice = 655 , meanbuyprice = 655, lastbuyprice_withDiscount = 646.16, meanbuyprice_withDiscount = 646.16
        , lastbuyprice_withTax = 655, meanbuyprice_withTax = 655, lastbuyprice_withDiscountAndTax = 646.16
                where buybilldetailid = 26;
UPDATE productunit SET proUnitBuyPrice  = 655 * productnumber WHERE productid = 1337;
UPDATE storedetail SET  productquantity = '25', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1337';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1337', '1', '25', '0', '6', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '25', '1', '2026-09-30 14:41:43','0','0'); -- id=1417
UPDATE supplier SET  suppliercurrentDebt = '884805',suppliercurrentDebtInCurrency= '622040' , userid = '1', supplierdate = '2026-09-30 14:44:02'   WHERE supplierid = '26';
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 ('26', '808795.00', '76010', '0', 'اضافة فاتورة مشتريات', '6', '884805', '2026-09-30 14:41:43', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','76010','1','546030','76010','622040','0',''); -- id=83
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '76010', '76010', '2026-09-30', '1', '0', '0', '2026-09-30 14:44:02','اضافة فاتورة مشتريات رقم 6','1','0',null,'0','6','buyBillController.php?do=details&id=6'); -- id=804
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('804', '382', '76010', '','0'); -- id=805
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12449010', 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 ('804', '445', '76010', '','0'); -- id=804
UPDATE accountstree SET name = 'الدولي - مورد', customName = 'الدولي - مورد', customNameEn = 'الدولي - مورد', nameEn = 'الدولي - مورد', parent = '81', accountNature = '1', theValue = '76010', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 13:17:33' WHERE id = '445';
update buybill set dailyentryid='804,0' where buybillid=6;
COMMIT;
UPDATE product SET overAllAveragePrice = 591.9 WHERE productId = 1331;UPDATE product SET overAllAveragePrice = 641.23 WHERE productId = 1332;UPDATE product SET overAllAveragePrice = 503.12 WHERE productId = 1333;UPDATE product SET overAllAveragePrice = 557.37 WHERE productId = 1334;UPDATE product SET overAllAveragePrice = 621.5 WHERE productId = 1335;UPDATE product SET overAllAveragePrice = 537.64 WHERE productId = 1336;UPDATE product SET overAllAveragePrice = 646.16 WHERE productId = 1337;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:14:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:44:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 14:44:03', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1111
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:15:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:45:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 14:45:11', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add&return_url=1&billnameid=1'); -- id=1112
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 ('06abcf6030b69c', '2026-09-30 14:44:03', '44', '546030.00', '655630', '0', '0', '109600.00',  '109600.00', '0', '109600', '1', '2026-09-30 14:45:11', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=7
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 ('01327', '7', '37', '1327', '40', '460', '18400.00', '0', '', '2026-09-30 14:45:11', '1327','','','0','0','0','0','0',null,'460','18400','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 ('2026-09-30 14:44:03', 1, 1327, 0, 0
                    , 460, 40, 0, 0, 1, '2026-09-30 14:45:11')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:45:11' ; -- id=32
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1327', '460', '40', '0', 'buyBillController.php', '27', '', '0', '0'); -- id=22
UPDATE product SET  productBuyPrice = "460" WHERE productId = 1327 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 27 ;
UPDATE product SET productName = 'تقطيع ليزر 2002 ميلانو 480', productDescription = '', productCatId = '37', productBuyPrice = '460.00', productSellAllPrice = '480.00', productSellUnitPrice = '480.00', productSellHalfPrice = '480.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01327',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.35' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',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='460',meanbuyprice_withTax='460',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='460',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1327';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 27;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 1327;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1327';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1327', '1', '40', '0', '7', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-09-30 14:44:03','0','0'); -- id=1418
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 ('01328', '7', '37', '1328', '40', '550', '22000.00', '0', '', '2026-09-30 14:45:11', '1328','','','0','0','0','0','0',null,'550','22000','0','0','0','0','0','0','0','0','1'); -- id=28
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:44:03', 1, 1328, 0, 0
                    , 550, 40, 0, 0, 1, '2026-09-30 14:45:11')
                ON DUPLICATE KEY UPDATE buyprice = 550,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:45:11' ; -- id=33
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1328', '550', '40', '0', 'buyBillController.php', '28', '', '0', '0'); -- id=23
UPDATE product SET  productBuyPrice = "550" WHERE productId = 1328 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 28 ;
UPDATE product SET productName = 'تمساح استراس تقطيع 2018 ميلانو 570', productDescription = '', productCatId = '37', productBuyPrice = '550.00', productSellAllPrice = '570.00', productSellUnitPrice = '570.00', productSellHalfPrice = '570.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01328',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '550',meanbuyprice_withDiscount = '550' , productbuypricereal = '550.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.64' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='550',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='550',meanbuyprice_withTax='550',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='550',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1328';
UPDATE buybilldetail SET  lastbuyprice = 550 , meanbuyprice = 550, lastbuyprice_withDiscount = 550, meanbuyprice_withDiscount = 550
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 550
                where buybilldetailid = 28;
UPDATE productunit SET proUnitBuyPrice  = 550 * productnumber WHERE productid = 1328;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1328';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1328', '1', '40', '0', '7', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-09-30 14:44:03','0','0'); -- id=1419
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 ('01329', '7', '37', '1329', '40', '570', '22800.00', '0', '', '2026-09-30 14:45:11', '1329','','','0','0','0','0','0',null,'570','22800','0','0','0','0','0','0','0','0','1'); -- id=29
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:44:03', 1, 1329, 0, 0
                    , 570, 40, 0, 0, 1, '2026-09-30 14:45:11')
                ON DUPLICATE KEY UPDATE buyprice = 570,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:45:11' ; -- id=34
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1329', '570', '40', '0', 'buyBillController.php', '29', '', '0', '0'); -- id=24
UPDATE product SET  productBuyPrice = "570" WHERE productId = 1329 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 29 ;
UPDATE product SET productName = 'حصان الماظ حزام 2021 ميلانو 590', productDescription = '', productCatId = '37', productBuyPrice = '570.00', productSellAllPrice = '590.00', productSellUnitPrice = '590.00', productSellHalfPrice = '590.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01329',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '570',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '570.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.51' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='570',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='570',meanbuyprice_withTax='570',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='570',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1329';
UPDATE buybilldetail SET  lastbuyprice = 570 , meanbuyprice = 570, lastbuyprice_withDiscount = 570, meanbuyprice_withDiscount = 570
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where buybilldetailid = 29;
UPDATE productunit SET proUnitBuyPrice  = 570 * productnumber WHERE productid = 1329;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1329';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1329', '1', '40', '0', '7', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-09-30 14:44:03','0','0'); -- id=1420
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 ('01330', '7', '37', '1330', '80', '580', '46400.00', '0', '', '2026-09-30 14:45:11', '1330','','','0','0','0','0','0',null,'580','46400','0','0','0','0','0','0','0','0','1'); -- id=30
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 14:44:03', 1, 1330, 0, 0
                    , 580, 80, 0, 0, 1, '2026-09-30 14:45:11')
                ON DUPLICATE KEY UPDATE buyprice = 580,
                        buyQuantity =buyQuantity+80, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 14:45:11' ; -- id=35
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1330', '580', '80', '0', 'buyBillController.php', '30', '', '0', '0'); -- id=25
UPDATE product SET  productBuyPrice = "580" WHERE productId = 1330 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 30 ;
UPDATE product SET productName = 'اميري فوطه كلمه 2022 ميلانو 600', productDescription = '', productCatId = '37', productBuyPrice = '580.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01330',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580',lastbuyprice_withDiscount = '580',meanbuyprice = '580',meanbuyprice_withDiscount = '580' , productbuypricereal = '580.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.45' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='580',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='580',meanbuyprice_withTax='580',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='580',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1330';
UPDATE buybilldetail SET  lastbuyprice = 580 , meanbuyprice = 580, lastbuyprice_withDiscount = 580, meanbuyprice_withDiscount = 580
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where buybilldetailid = 30;
UPDATE productunit SET proUnitBuyPrice  = 580 * productnumber WHERE productid = 1330;
UPDATE storedetail SET  productquantity = '80', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1330';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1330', '1', '80', '0', '7', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '80', '1', '2026-09-30 14:44:03','0','0'); -- id=1421
UPDATE supplier SET  suppliercurrentDebt = '371910',suppliercurrentDebtInCurrency= '655630' , userid = '1', supplierdate = '2026-09-30 14:45:11'   WHERE supplierid = '44';
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 ('44', '262310.00', '109600', '0', 'اضافة فاتورة مشتريات', '7', '371910', '2026-09-30 14:44:03', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','109600','1','546030','109600','655630','0',''); -- id=84
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '109600', '109600', '2026-09-30', '1', '0', '0', '2026-09-30 14:45:11','اضافة فاتورة مشتريات رقم 7','1','0',null,'0','7','buyBillController.php?do=details&id=7'); -- id=805
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('805', '382', '109600', '','0'); -- id=806
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12558610', 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 ('805', '463', '109600', '','0'); -- id=805
UPDATE accountstree SET name = 'ميلانو - مورد', customName = 'ميلانو - مورد', customNameEn = 'ميلانو - مورد', nameEn = 'ميلانو - مورد', parent = '81', accountNature = '1', theValue = '109600', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 13:17:33' WHERE id = '463';
update buybill set dailyentryid='805,0' where buybillid=7;
COMMIT;
UPDATE product SET overAllAveragePrice = 460 WHERE productId = 1327;UPDATE product SET overAllAveragePrice = 550 WHERE productId = 1328;UPDATE product SET overAllAveragePrice = 570 WHERE productId = 1329;UPDATE product SET overAllAveragePrice = 580 WHERE productId = 1330;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:15:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:45:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 14:45:11', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1113
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:19:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 14:49:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 14:49:20', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1114
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:33:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:03:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 15:03:03', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1115
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:33:03";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-09-30 15:03:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 15:03:03', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1116
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:33:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:03:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 15:03:08', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1117
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:41:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:11:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 15:11:07', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=1118
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:41:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:11:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:11:46', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1119
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:42:06";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:12:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:12:06', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1120
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:42:52";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:12:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:12:52', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1121
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 11:45:53";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:15:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:15:53', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1122
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount,taxfile,fileimg,webStoreType,clientaddress3,tagids,email_verified,email_otp,email_otp_expiry) VALUES ('محل الفيوم عروض' , '', '', '', '0', '', '0', '2026-09-30 15:30:47', '2', '0','','0','','-10','0','0',',','-1','0','.','0','0','.','2026-09-30','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','','','','0','','','0','0',''); -- id=3
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('3', '0', '0', '', ''); -- id=2
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('3','0','0','0','إضافة عميل جديد','3', '0', '2026-09-30 15:30:47', '2', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','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 ('محل الفيوم عروض', 'محل الفيوم عروض', 'محل الفيوم عروض', 'محل الفيوم عروض', '58', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '2', '0', '2026-09-30 15:30:47'); -- id=495
UPDATE client SET clientname = 'محل الفيوم عروض', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2026-09-30', userid = '2'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='0' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='495',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='0000-00-00 00:00:00' WHERE clientid = '3';
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount,taxfile,fileimg,webStoreType,clientaddress3,tagids,email_verified,email_otp,email_otp_expiry) VALUES ('VIP' , '', '', '', '0', '', '0', '2026-09-30 15:38:11', '2', '0','','0','','-10','0','0',',','-1','0','.','0','0','.','2026-09-30','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','','','','0','','','0','0',''); -- id=4
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('4', '0', '0', '', ''); -- id=3
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('4','0','0','0','إضافة عميل جديد','4', '0', '2026-09-30 15:38:11', '2', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0','',''); -- id=26
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('VIP', 'VIP', 'VIP', 'VIP', '58', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '2', '0', '2026-09-30 15:38:11'); -- id=496
UPDATE client SET clientname = 'VIP', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2026-09-30', userid = '2'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='0' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='496',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='0000-00-00 00:00:00' WHERE clientid = '4';
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount,taxfile,fileimg,webStoreType,clientaddress3,tagids,email_verified,email_otp,email_otp_expiry) VALUES ('محل VIP' , '', '', '', '0', '', '0', '2026-09-30 15:40:12', '2', '0','','0','','-10','0','0',',','-1','0','.','0','0','.','2026-09-30','0','0','','0','0','0','01090856430','','0','0','','','','','','','','','','-1','','','','0','','','0','0',''); -- id=5
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('5', '0', '0', '', ''); -- id=4
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('5','0','0','0','إضافة عميل جديد','5', '0', '2026-09-30 15:40:12', '2', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0','',''); -- id=27
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('محل VIP', 'محل VIP', 'محل VIP', 'محل VIP', '58', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '2', '0', '2026-09-30 15:40:12'); -- id=497
UPDATE client SET clientname = 'محل VIP', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2026-09-30', userid = '2'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='0' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='01090856430', password='',clientTypeForTree='0',treeId='497',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='0000-00-00 00:00:00' WHERE clientid = '5';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:15:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:45:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 15:45:43', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1123
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:17:22";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:47:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 15:47:22', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add&return_url=1&billnameid=1'); -- id=1124
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 ('06abd0477933fc', '2026-09-30 15:45:43', '6', '546030.00', '731775', '0', '0', '185745.00',  '185745.00', '0', '185745', '1', '2026-09-30 15:47:22', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=8
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 ('01344', '8', '31', '1344', '40', '485', '19400.00', '0', '', '2026-09-30 15:47:22', '1344','','','0','0','0','0','0',null,'485','19400','0','0','0','0','0','0','0','0','1'); -- id=31
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 15:45:43', 1, 1344, 0, 0
                    , 485, 40, 0, 0, 1, '2026-09-30 15:47:22')
                ON DUPLICATE KEY UPDATE buyprice = 485,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 15:47:22' ; -- id=36
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1344', '485', '40', '0', 'buyBillController.php', '31', '', '0', '0'); -- id=26
UPDATE product SET  productBuyPrice = "485" WHERE productId = 1344 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 31 ;
UPDATE product SET productName = 'بلمن جلد 6136 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '485.00', productSellAllPrice = '505.00', productSellUnitPrice = '505.00', productSellHalfPrice = '505.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01344',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '485',lastbuyprice_withDiscount = '485',meanbuyprice = '485',meanbuyprice_withDiscount = '485' , productbuypricereal = '485.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.12' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='485',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='485',meanbuyprice_withTax='485',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='485',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1344';
UPDATE buybilldetail SET  lastbuyprice = 485 , meanbuyprice = 485, lastbuyprice_withDiscount = 485, meanbuyprice_withDiscount = 485
        , lastbuyprice_withTax = 485, meanbuyprice_withTax = 485, lastbuyprice_withDiscountAndTax = 485
                where buybilldetailid = 31;
UPDATE productunit SET proUnitBuyPrice  = 485 * productnumber WHERE productid = 1344;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1344', '1', '40', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-09-30 15:45:43','0','0'); -- id=1422
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 ('01345', '8', '31', '1345', '36', '570', '20520.00', '0', '', '2026-09-30 15:47:22', '1345','','','0','0','0','0','0',null,'570','20520','0','0','0','0','0','0','0','0','1'); -- id=32
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 15:45:43', 1, 1345, 0, 0
                    , 570, 36, 0, 0, 1, '2026-09-30 15:47:22')
                ON DUPLICATE KEY UPDATE buyprice = 570,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 15:47:22' ; -- id=37
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1345', '570', '36', '0', 'buyBillController.php', '32', '', '0', '0'); -- id=27
UPDATE product SET  productBuyPrice = "570" WHERE productId = 1345 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 32 ;
UPDATE product SET productName = 'لامبورجيني 6144 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '570.00', productSellAllPrice = '590.00', productSellUnitPrice = '590.00', productSellHalfPrice = '590.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01345',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '570',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '570.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.51' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='570',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='570',meanbuyprice_withTax='570',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='570',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1345';
UPDATE buybilldetail SET  lastbuyprice = 570 , meanbuyprice = 570, lastbuyprice_withDiscount = 570, meanbuyprice_withDiscount = 570
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where buybilldetailid = 32;
UPDATE productunit SET proUnitBuyPrice  = 570 * productnumber WHERE productid = 1345;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1345';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1345', '1', '36', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '1', '2026-09-30 15:45:43','0','0'); -- id=1423
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 ('01346', '8', '31', '1346', '36', '535', '19260.00', '0', '', '2026-09-30 15:47:22', '1346','','','0','0','0','0','0',null,'535','19260','0','0','0','0','0','0','0','0','1'); -- id=33
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 15:45:43', 1, 1346, 0, 0
                    , 535, 36, 0, 0, 1, '2026-09-30 15:47:22')
                ON DUPLICATE KEY UPDATE buyprice = 535,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 15:47:22' ; -- id=38
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1346', '535', '36', '0', 'buyBillController.php', '33', '', '0', '0'); -- id=28
UPDATE product SET  productBuyPrice = "535" WHERE productId = 1346 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 33 ;
UPDATE product SET productName = 'سيليكون تطريز 6156 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '535.00', productSellAllPrice = '555.00', productSellUnitPrice = '555.00', productSellHalfPrice = '555.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01346',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '535',lastbuyprice_withDiscount = '535',meanbuyprice = '535',meanbuyprice_withDiscount = '535' , productbuypricereal = '535.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.74' , buyhalf_precentage = '3.74' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='535',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='535',meanbuyprice_withTax='535',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='535',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1346';
UPDATE buybilldetail SET  lastbuyprice = 535 , meanbuyprice = 535, lastbuyprice_withDiscount = 535, meanbuyprice_withDiscount = 535
        , lastbuyprice_withTax = 535, meanbuyprice_withTax = 535, lastbuyprice_withDiscountAndTax = 535
                where buybilldetailid = 33;
UPDATE productunit SET proUnitBuyPrice  = 535 * productnumber WHERE productid = 1346;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1346';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1346', '1', '36', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '1', '2026-09-30 15:45:43','0','0'); -- id=1424
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 ('01347', '8', '31', '1347', '35', '475', '16625.00', '0', '', '2026-09-30 15:47:22', '1347','','','0','0','0','0','0',null,'475','16625','0','0','0','0','0','0','0','0','1'); -- id=34
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 15:45:43', 1, 1347, 0, 0
                    , 475, 35, 0, 0, 1, '2026-09-30 15:47:22')
                ON DUPLICATE KEY UPDATE buyprice = 475,
                        buyQuantity =buyQuantity+35, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 15:47:22' ; -- id=39
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1347', '475', '35', '0', 'buyBillController.php', '34', '', '0', '0'); -- id=29
UPDATE product SET  productBuyPrice = "475" WHERE productId = 1347 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 34 ;
UPDATE product SET productName = 'باجي فيت حزام 6157 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '475.00', productSellAllPrice = '495.00', productSellUnitPrice = '495.00', productSellHalfPrice = '495.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01347',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475',lastbuyprice_withDiscount = '475',meanbuyprice = '475',meanbuyprice_withDiscount = '475' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '25.26' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='475',meanbuyprice_withTax='475',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='475',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1347';
UPDATE buybilldetail SET  lastbuyprice = 475 , meanbuyprice = 475, lastbuyprice_withDiscount = 475, meanbuyprice_withDiscount = 475
        , lastbuyprice_withTax = 475, meanbuyprice_withTax = 475, lastbuyprice_withDiscountAndTax = 475
                where buybilldetailid = 34;
UPDATE productunit SET proUnitBuyPrice  = 475 * productnumber WHERE productid = 1347;
UPDATE storedetail SET  productquantity = '35', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1347';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1347', '1', '35', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '35', '1', '2026-09-30 15:45:43','0','0'); -- id=1425
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 ('01348', '8', '31', '1348', '40', '440', '17600.00', '0', '', '2026-09-30 15:47:22', '1348','','','0','0','0','0','0',null,'440','17600','0','0','0','0','0','0','0','0','1'); -- id=35
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 15:45:43', 1, 1348, 0, 0
                    , 440, 40, 0, 0, 1, '2026-09-30 15:47:22')
                ON DUPLICATE KEY UPDATE buyprice = 440,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 15:47:22' ; -- id=40
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1348', '440', '40', '0', 'buyBillController.php', '35', '', '0', '0'); -- id=30
UPDATE product SET  productBuyPrice = "440" WHERE productId = 1348 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 35 ;
UPDATE product SET productName = 'سيليكون ال في 6158 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '440.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01348',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440',lastbuyprice_withDiscount = '440',meanbuyprice = '440',meanbuyprice_withDiscount = '440' , productbuypricereal = '440.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',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='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1348';
UPDATE buybilldetail SET  lastbuyprice = 440 , meanbuyprice = 440, lastbuyprice_withDiscount = 440, meanbuyprice_withDiscount = 440
        , lastbuyprice_withTax = 440, meanbuyprice_withTax = 440, lastbuyprice_withDiscountAndTax = 440
                where buybilldetailid = 35;
UPDATE productunit SET proUnitBuyPrice  = 440 * productnumber WHERE productid = 1348;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1348';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1348', '1', '40', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-09-30 15:45:43','0','0'); -- id=1426
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 ('01349', '8', '31', '1349', '40', '440', '17600.00', '0', '', '2026-09-30 15:47:22', '1349','','','0','0','0','0','0',null,'440','17600','0','0','0','0','0','0','0','0','1'); -- id=36
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 15:45:43', 1, 1349, 0, 0
                    , 440, 40, 0, 0, 1, '2026-09-30 15:47:22')
                ON DUPLICATE KEY UPDATE buyprice = 440,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 15:47:22' ; -- id=41
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1349', '440', '40', '0', 'buyBillController.php', '36', '', '0', '0'); -- id=31
UPDATE product SET  productBuyPrice = "440" WHERE productId = 1349 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 36 ;
UPDATE product SET productName = 'سيليكون برادا 6159 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '440.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01349',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440',lastbuyprice_withDiscount = '440',meanbuyprice = '440',meanbuyprice_withDiscount = '440' , productbuypricereal = '440.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',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='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1349';
UPDATE buybilldetail SET  lastbuyprice = 440 , meanbuyprice = 440, lastbuyprice_withDiscount = 440, meanbuyprice_withDiscount = 440
        , lastbuyprice_withTax = 440, meanbuyprice_withTax = 440, lastbuyprice_withDiscountAndTax = 440
                where buybilldetailid = 36;
UPDATE productunit SET proUnitBuyPrice  = 440 * productnumber WHERE productid = 1349;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1349';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1349', '1', '40', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-09-30 15:45:43','0','0'); -- id=1427
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 ('01350', '8', '31', '1350', '40', '555', '22200.00', '0', '', '2026-09-30 15:47:22', '1350','','','0','0','0','0','0',null,'555','22200','0','0','0','0','0','0','0','0','1'); -- id=37
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 15:45:43', 1, 1350, 0, 0
                    , 555, 40, 0, 0, 1, '2026-09-30 15:47:22')
                ON DUPLICATE KEY UPDATE buyprice = 555,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 15:47:22' ; -- id=42
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1350', '555', '40', '0', 'buyBillController.php', '37', '', '0', '0'); -- id=32
UPDATE product SET  productBuyPrice = "555" WHERE productId = 1350 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 37 ;
UPDATE product SET productName = 'اميري تطريز 6161 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '555.00', productSellAllPrice = '575.00', productSellUnitPrice = '575.00', productSellHalfPrice = '575.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01350',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '555',lastbuyprice_withDiscount = '555',meanbuyprice = '555',meanbuyprice_withDiscount = '555' , productbuypricereal = '555.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.60' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='555',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='555',meanbuyprice_withTax='555',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='555',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1350';
UPDATE buybilldetail SET  lastbuyprice = 555 , meanbuyprice = 555, lastbuyprice_withDiscount = 555, meanbuyprice_withDiscount = 555
        , lastbuyprice_withTax = 555, meanbuyprice_withTax = 555, lastbuyprice_withDiscountAndTax = 555
                where buybilldetailid = 37;
UPDATE productunit SET proUnitBuyPrice  = 555 * productnumber WHERE productid = 1350;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1350';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1350', '1', '40', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-09-30 15:45:43','0','0'); -- id=1428
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 ('01351', '8', '31', '1351', '35', '440', '15400.00', '0', '', '2026-09-30 15:47:22', '1351','','','0','0','0','0','0',null,'440','15400','0','0','0','0','0','0','0','0','1'); -- id=38
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 15:45:43', 1, 1351, 0, 0
                    , 440, 35, 0, 0, 1, '2026-09-30 15:47:22')
                ON DUPLICATE KEY UPDATE buyprice = 440,
                        buyQuantity =buyQuantity+35, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 15:47:22' ; -- id=43
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1351', '440', '35', '0', 'buyBillController.php', '38', '', '0', '0'); -- id=33
UPDATE product SET  productBuyPrice = "440" WHERE productId = 1351 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 38 ;
UPDATE product SET productName = 'رمادي ميداليه 6164 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '440.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01351',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440',lastbuyprice_withDiscount = '440',meanbuyprice = '440',meanbuyprice_withDiscount = '440' , productbuypricereal = '440.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',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='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1351';
UPDATE buybilldetail SET  lastbuyprice = 440 , meanbuyprice = 440, lastbuyprice_withDiscount = 440, meanbuyprice_withDiscount = 440
        , lastbuyprice_withTax = 440, meanbuyprice_withTax = 440, lastbuyprice_withDiscountAndTax = 440
                where buybilldetailid = 38;
UPDATE productunit SET proUnitBuyPrice  = 440 * productnumber WHERE productid = 1351;
UPDATE storedetail SET  productquantity = '35', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1351';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1351', '1', '35', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '35', '1', '2026-09-30 15:45:43','0','0'); -- id=1429
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 ('01352', '8', '31', '1352', '36', '615', '22140.00', '0', '', '2026-09-30 15:47:22', '1352','','','0','0','0','0','0',null,'615','22140','0','0','0','0','0','0','0','0','1'); -- id=39
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 15:45:43', 1, 1352, 0, 0
                    , 615, 36, 0, 0, 1, '2026-09-30 15:47:22')
                ON DUPLICATE KEY UPDATE buyprice = 615,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 15:47:22' ; -- id=44
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1352', '615', '36', '0', 'buyBillController.php', '39', '', '0', '0'); -- id=34
UPDATE product SET  productBuyPrice = "615" WHERE productId = 1352 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 39 ;
UPDATE product SET productName = 'بانك 6169 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '615.00', productSellAllPrice = '635.00', productSellUnitPrice = '635.00', productSellHalfPrice = '635.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01352',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '615',lastbuyprice_withDiscount = '615',meanbuyprice = '615',meanbuyprice_withDiscount = '615' , productbuypricereal = '615.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.25' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615',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='615',meanbuyprice_withTax='615',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='615',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1352';
UPDATE buybilldetail SET  lastbuyprice = 615 , meanbuyprice = 615, lastbuyprice_withDiscount = 615, meanbuyprice_withDiscount = 615
        , lastbuyprice_withTax = 615, meanbuyprice_withTax = 615, lastbuyprice_withDiscountAndTax = 615
                where buybilldetailid = 39;
UPDATE productunit SET proUnitBuyPrice  = 615 * productnumber WHERE productid = 1352;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1352', '1', '36', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '1', '2026-09-30 15:45:43','0','0'); -- id=1430
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 ('01353', '8', '31', '1353', '25', '600', '15000.00', '0', '', '2026-09-30 15:47:22', '1353','','','0','0','0','0','0',null,'600','15000','0','0','0','0','0','0','0','0','1'); -- id=40
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 15:45:43', 1, 1353, 0, 0
                    , 600, 25, 0, 0, 1, '2026-09-30 15:47:22')
                ON DUPLICATE KEY UPDATE buyprice = 600,
                        buyQuantity =buyQuantity+25, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 15:47:22' ; -- id=45
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1353', '600', '25', '0', 'buyBillController.php', '40', '', '0', '0'); -- id=35
UPDATE product SET  productBuyPrice = "600" WHERE productId = 1353 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 40 ;
UPDATE product SET productName = 'استراس 6171 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '600.00', productSellAllPrice = '620.00', productSellUnitPrice = '620.00', productSellHalfPrice = '620.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01353',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '600',meanbuyprice = '600',meanbuyprice_withDiscount = '600' , productbuypricereal = '600.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.33' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='600',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='600',meanbuyprice_withTax='600',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='600',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1353';
UPDATE buybilldetail SET  lastbuyprice = 600 , meanbuyprice = 600, lastbuyprice_withDiscount = 600, meanbuyprice_withDiscount = 600
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where buybilldetailid = 40;
UPDATE productunit SET proUnitBuyPrice  = 600 * productnumber WHERE productid = 1353;
UPDATE storedetail SET  productquantity = '25', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1353';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1353', '1', '25', '0', '8', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '25', '1', '2026-09-30 15:45:43','0','0'); -- id=1431
UPDATE supplier SET  suppliercurrentDebt = '1021282',suppliercurrentDebtInCurrency= '731775' , userid = '1', supplierdate = '2026-09-30 15:47:22'   WHERE supplierid = '6';
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 ('6', '835537.00', '185745', '0', 'اضافة فاتورة مشتريات', '8', '1021282', '2026-09-30 15:45:43', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','185745','1','546030','185745','731775','0',''); -- id=85
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '185745', '185745', '2026-09-30', '1', '0', '0', '2026-09-30 15:47:22','اضافة فاتورة مشتريات رقم 8','1','0',null,'0','8','buyBillController.php?do=details&id=8'); -- id=806
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('806', '382', '185745', '','0'); -- id=807
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12744355', 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 ('806', '425', '185745', '','0'); -- id=806
UPDATE accountstree SET name = 'فيلو - مورد', customName = 'فيلو - مورد', customNameEn = 'فيلو - مورد', nameEn = 'فيلو - مورد', parent = '81', accountNature = '1', theValue = '185745', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 13:17:33' WHERE id = '425';
update buybill set dailyentryid='806,0' where buybillid=8;
COMMIT;
UPDATE product SET overAllAveragePrice = 485 WHERE productId = 1344;UPDATE product SET overAllAveragePrice = 570 WHERE productId = 1345;UPDATE product SET overAllAveragePrice = 535 WHERE productId = 1346;UPDATE product SET overAllAveragePrice = 475 WHERE productId = 1347;UPDATE product SET overAllAveragePrice = 440 WHERE productId = 1348;UPDATE product SET overAllAveragePrice = 440 WHERE productId = 1349;UPDATE product SET overAllAveragePrice = 555 WHERE productId = 1350;UPDATE product SET overAllAveragePrice = 440 WHERE productId = 1351;UPDATE product SET overAllAveragePrice = 615 WHERE productId = 1352;UPDATE product SET overAllAveragePrice = 600 WHERE productId = 1353;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:17:22";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:47:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 15:47:22', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1125
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:18:30";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:48:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 15:48:30', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1126

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abcfa7c85075
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(5,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 15:48:30', '06abcfa7c85075', '5', '0.00', '0', '0', '1', '129345.00', '129345', '129345', '0', '1', '2026-09-30 15:48:30', '', '2', '0', 'محل VIP', '2', '1', '3', '0', 'محل VIP', '238' ,'0','','','','','-1','0','0','0','0','0','129345','0','','0','0','129345','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-30','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=16
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '5';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('5','0.00','0','0','اضافة فاتورة مبيعات','16', '0', '2026-09-30 15:48:30', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '129345', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 15:48:30','0','0','',''); -- id=28
UPDATE client SET  inUse = 0 where clientid = 5;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 7;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('430','07429', '16', '19', '833', '15', '450', '6750', '0', '', '0', '2026-09-30 15:48:30', '833', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','7-15,','1','1','0','0','450','6750','0','','0','','0','0','0','0'); -- id=26
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 26;
 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 (833, '2026-09-30', 6750, 6450, 6450
                    , 6450, 6450, 6450, 6450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 6450, 6450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6750, sellCostBuyPrice =sellCostBuyPrice+6450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6750, 6450, 6450
                    , 6450, 6450, 6450, 6450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6450, 6450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6750, sellCostBuyPrice =sellCostBuyPrice+6450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6450
                        , returnSellVal = returnSellVal+0, 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 = '49', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '833';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('833', '1', '15', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '64', '49', '2', '2026-09-30 15:48:30','0','0'); -- id=1432
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+25 where id = 6;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','01322', '16', '39', '1322', '25', '385', '9625', '0', '', '0', '2026-09-30 15:48:30', '1322', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6-25,','1','1','0','0','385','9625','0','','0','','0','0','0','0'); -- id=27
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 27;
 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 (1322, '2026-09-30', 9625, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 25, 0, 9000, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9625, sellCostBuyPrice =sellCostBuyPrice+9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+25
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9625, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9000, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9625, sellCostBuyPrice =sellCostBuyPrice+9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1322';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1322', '1', '25', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '20', '2', '2026-09-30 15:48:30','0','0'); -- id=1433
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 5;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','01321', '16', '39', '1321', '20', '400', '8000', '0', '', '0', '2026-09-30 15:48:30', '1321', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','5-20,','1','1','0','0','400','8000','0','','0','','0','0','0','0'); -- id=28
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        , lastbuyprice_withTax = 375, meanbuyprice_withTax = 187.5, lastbuyprice_withDiscountAndTax = 375
                where sellbilldetailid = 28;
 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 (1321, '2026-09-30', 8000, 7500, 7500
                    , 7500, 7500, 7500, 7500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 7500, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8000, sellCostBuyPrice =sellCostBuyPrice+7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 8000, 7500, 7500
                    , 7500, 7500, 7500, 7500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7500, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8000, sellCostBuyPrice =sellCostBuyPrice+7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1321';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1321', '1', '20', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '20', '2', '2026-09-30 15:48:30','0','0'); -- id=1434
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 28;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('557.37','01334', '16', '8', '1334', '10', '585', '5850', '0', '', '0', '2026-09-30 15:48:30', '1334', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','28-10,','1','1','0','0','585','5850','0','','0','','0','0','0','0'); -- id=29
UPDATE sellbilldetail SET  lastbuyprice = 565.00 , meanbuyprice = 565.00, lastbuyprice_withDiscount = 557.37, meanbuyprice_withDiscount = 557.37
        , lastbuyprice_withTax = 565, meanbuyprice_withTax = 565, lastbuyprice_withDiscountAndTax = 557.37
                where sellbilldetailid = 29;
 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 (1334, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5850, sellCostBuyPrice =sellCostBuyPrice+5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5850, sellCostBuyPrice =sellCostBuyPrice+5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1334';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1334', '1', '10', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '0', '2', '2026-09-30 15:48:30','0','0'); -- id=1435
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 21;
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 ('625','01341', '16', '28', '1341', '5', '645', '3225', '0', '', '0', '2026-09-30 15:48:30', '1341', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','21-5,','1','1','0','0','645','3225','0','','0','','0','0','0','0'); -- id=30
UPDATE sellbilldetail SET  lastbuyprice = 625.00 , meanbuyprice = 625.00, lastbuyprice_withDiscount = 625.00, meanbuyprice_withDiscount = 625.00
        , lastbuyprice_withTax = 625, meanbuyprice_withTax = 625, lastbuyprice_withDiscountAndTax = 625
                where sellbilldetailid = 30;
 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 (1341, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3125
                        , returnSellVal = returnSellVal+0, 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 = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1341';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1341', '1', '5', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-09-30 15:48:30','0','0'); -- id=1436
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 19;
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 ('430','01339', '16', '28', '1339', '20', '450', '9000', '0', '', '0', '2026-09-30 15:48:30', '1339', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','19-20,','1','1','0','0','450','9000','0','','0','','0','0','0','0'); -- id=31
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 31;
 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 (1339, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1339';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1339', '1', '20', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '5', '2', '2026-09-30 15:48:30','0','0'); -- id=1437
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 24;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('510','09724', '16', '28', '945', '15', '530', '7950', '0', '', '0', '2026-09-30 15:48:30', '945', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','24-15,','1','1','0','0','530','7950','0','','0','','0','0','0','0'); -- id=32
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 510
                where sellbilldetailid = 32;
 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 (945, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7950, sellCostBuyPrice =sellCostBuyPrice+7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7950, sellCostBuyPrice =sellCostBuyPrice+7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '945';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('945', '1', '15', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '35', '20', '2', '2026-09-30 15:48:30','0','0'); -- id=1438
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 20;
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 ('630','01340', '16', '28', '1340', '5', '650', '3250', '0', '', '0', '2026-09-30 15:48:30', '1340', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','20-5,','1','1','0','0','650','3250','0','','0','','0','0','0','0'); -- id=33
UPDATE sellbilldetail SET  lastbuyprice = 630.00 , meanbuyprice = 630.00, lastbuyprice_withDiscount = 630.00, meanbuyprice_withDiscount = 630.00
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 630, lastbuyprice_withDiscountAndTax = 630
                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 (1340, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, 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 = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1340';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1340', '1', '5', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-09-30 15:48:30','0','0'); -- id=1439
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 18;
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 ('700','01338', '16', '28', '1338', '5', '720', '3600', '0', '', '0', '2026-09-30 15:48:30', '1338', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','18-5,','1','1','0','0','720','3600','0','','0','','0','0','0','0'); -- id=34
UPDATE sellbilldetail SET  lastbuyprice = 700.00 , meanbuyprice = 700.00, lastbuyprice_withDiscount = 700.00, meanbuyprice_withDiscount = 700.00
        , lastbuyprice_withTax = 700, meanbuyprice_withTax = 700, lastbuyprice_withDiscountAndTax = 700
                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 (1338, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, 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 = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1338';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1338', '1', '5', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-09-30 15:48:30','0','0'); -- id=1440
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 36;
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 ('485','01344', '16', '31', '1344', '15', '505', '7575', '0', '', '0', '2026-09-30 15:48:30', '1344', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','36-15,','1','1','0','0','505','7575','0','','0','','0','0','0','0'); -- id=35
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 485.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 485.00
        , lastbuyprice_withTax = 485, meanbuyprice_withTax = 485, lastbuyprice_withDiscountAndTax = 485
                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 (1344, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7575, sellCostBuyPrice =sellCostBuyPrice+7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7275
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7575, sellCostBuyPrice =sellCostBuyPrice+7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7275
                        , returnSellVal = returnSellVal+0, 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 = '25', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1344', '1', '15', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '25', '2', '2026-09-30 15:48:30','0','0'); -- id=1441
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 22;
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 ('750','01342', '16', '28', '1342', '5', '770', '3850', '0', '', '0', '2026-09-30 15:48:30', '1342', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','22-5,','1','1','0','0','770','3850','0','','0','','0','0','0','0'); -- id=36
UPDATE sellbilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 750.00, meanbuyprice_withDiscount = 750.00
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 750, lastbuyprice_withDiscountAndTax = 750
                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 (1342, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1342';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1342', '1', '5', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '2', '2026-09-30 15:48:30','0','0'); -- id=1442
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 26;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('641.23','01332', '16', '8', '1332', '5', '670', '3350', '0', '', '0', '2026-09-30 15:48:30', '1332', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','26-5,','1','1','0','0','670','3350','0','','0','','0','0','0','0'); -- id=37
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 641.23, meanbuyprice_withDiscount = 641.23
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 650, lastbuyprice_withDiscountAndTax = 641.23
                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 (1332, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3350, sellCostBuyPrice =sellCostBuyPrice+3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3350, sellCostBuyPrice =sellCostBuyPrice+3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3250
                        , returnSellVal = returnSellVal+0, 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 = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1332';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1332', '1', '5', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-09-30 15:48:30','0','0'); -- id=1443
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 45;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('600','01353', '16', '31', '1353', '10', '620', '6200', '0', '', '0', '2026-09-30 15:48:30', '1353', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','45-10,','1','1','0','0','620','6200','0','','0','','0','0','0','0'); -- id=38
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                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 (1353, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6200, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6200, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1353';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1353', '1', '10', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '15', '2', '2026-09-30 15:48:30','0','0'); -- id=1444
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+18 where id = 37;
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 ('570','01345', '16', '31', '1345', '18', '590', '10620', '0', '', '0', '2026-09-30 15:48:30', '1345', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','37-18,','1','1','0','0','590','10620','0','','0','','0','0','0','0'); -- id=39
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                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 (1345, '2026-09-30', 10620, 10260, 10260
                    , 10260, 10260, 10260, 10260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 10260, 10260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10620, sellCostBuyPrice =sellCostBuyPrice+10260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10260
                        , returnSellVal = returnSellVal+0, 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+18
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 10620, 10260, 10260
                    , 10260, 10260, 10260, 10260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10260, 10260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10620, sellCostBuyPrice =sellCostBuyPrice+10260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10260
                        , returnSellVal = returnSellVal+0, 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 = '18', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1345';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1345', '1', '18', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '18', '2', '2026-09-30 15:48:30','0','0'); -- id=1445
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 23;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','01343', '16', '28', '1343', '5', '690', '3450', '0', '', '0', '2026-09-30 15:48:30', '1343', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','23-5,','1','1','0','0','690','3450','0','','0','','0','0','0','0'); -- id=40
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 40;
 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 (1343, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3450, sellCostBuyPrice =sellCostBuyPrice+3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3450, sellCostBuyPrice =sellCostBuyPrice+3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1343';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1343', '1', '5', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '2', '2026-09-30 15:48:30','0','0'); -- id=1446
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 25;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('591.9','01331', '16', '8', '1331', '5', '620', '3100', '0', '', '0', '2026-09-30 15:48:30', '1331', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','25-5,','1','1','0','0','620','3100','0','','0','','0','0','0','0'); -- id=41
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 591.90, meanbuyprice_withDiscount = 591.90
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 591.9
                where sellbilldetailid = 41;
 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 (1331, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1331';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1331', '1', '5', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '2', '2026-09-30 15:48:30','0','0'); -- id=1447
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 35;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('580','01330', '16', '37', '1330', '15', '600', '9000', '0', '', '0', '2026-09-30 15:48:30', '1330', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','35-15,','1','1','0','0','600','9000','0','','0','','0','0','0','0'); -- id=42
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 580.00, meanbuyprice_withDiscount = 580.00
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where sellbilldetailid = 42;
 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 (1330, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '65', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1330';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1330', '1', '15', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '80', '65', '2', '2026-09-30 15:48:30','0','0'); -- id=1448
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+30 where id = 44;
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 ('615','01352', '16', '31', '1352', '30', '635', '19050', '0', '', '0', '2026-09-30 15:48:30', '1352', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','44-30,','1','1','0','0','635','19050','0','','0','','0','0','0','0'); -- id=43
UPDATE sellbilldetail SET  lastbuyprice = 615.00 , meanbuyprice = 615.00, lastbuyprice_withDiscount = 615.00, meanbuyprice_withDiscount = 615.00
        , lastbuyprice_withTax = 615, meanbuyprice_withTax = 615, lastbuyprice_withDiscountAndTax = 615
                where sellbilldetailid = 43;
 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 (1352, '2026-09-30', 19050, 18450, 18450
                    , 18450, 18450, 18450, 18450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 18450, 18450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19050, sellCostBuyPrice =sellCostBuyPrice+18450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+30
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 19050, 18450, 18450
                    , 18450, 18450, 18450, 18450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18450, 18450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19050, sellCostBuyPrice =sellCostBuyPrice+18450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1352', '1', '30', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '6', '2', '2026-09-30 15:48:30','0','0'); -- id=1449
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 34;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('570','01329', '16', '37', '1329', '10', '590', '5900', '0', '', '0', '2026-09-30 15:48:30', '1329', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','34-10,','1','1','0','0','590','5900','0','','0','','0','0','0','0'); -- id=44
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 44;
 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 (1329, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5900, sellCostBuyPrice =sellCostBuyPrice+5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5900, sellCostBuyPrice =sellCostBuyPrice+5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '2', storedetaildate = '2026-09-30 15:48:30' WHERE storedetailid = '1329';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1329', '1', '10', '1', '16', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '30', '2', '2026-09-30 15:48:30','0','0'); -- id=1450
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '170255',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('40910','129345', '0', '2', 'اضافة فاتورة مبيعات', '16', '170255', '2026-09-30 15:48:30', '2',  'sellbillController.php','5','','0'); -- id=28
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '129345', '129345', '2026-09-30', '2', '0', '0', '2026-09-30 15:48:30','اضافة فاتورة مبيعات رقم 16','1','0',null,'0','16','sellbillController.php?do=showDetail&sellbillid=16'); -- id=807
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('807', '497', '129345', '','0'); -- id=808
UPDATE accountstree SET name = 'محل VIP', customName = 'محل VIP', customNameEn = 'محل VIP', nameEn = 'محل VIP', parent = '58', accountNature = '0', theValue = '129345', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:40:12' WHERE id = '497';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('807', '143', '129345', '','0'); -- id=807
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '190505', 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 ( '129345', '129345', '2026-09-30', '2', '0', '0', '2026-09-30 15:48:30','اضافة فاتورة مبيعات رقم 16 - تحصيل الفاتورة من العميل','1','0',null,'0','16','sellbillController.php?do=showDetail&sellbillid=16'); -- id=808
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('808', '419', '129345', '','0'); -- id=809
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '170255', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('808', '497', '129345', '','0'); -- id=808
UPDATE accountstree SET name = 'محل VIP', customName = 'محل VIP', customNameEn = 'محل VIP', nameEn = 'محل VIP', parent = '58', accountNature = '0', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:40:12' WHERE id = '497';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '124199.35', '124199.35', '2026-09-30', '2', '0', '0', '2026-09-30 15:48:30','اضافة فاتورة مبيعات رقم 16 - صرف البضاعة من المخزن','1','0',null,'0','16','sellbillController.php?do=showDetail&sellbillid=16'); -- id=809
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('809', '402', '124199.35', '','0'); -- id=810
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '190964.35', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('809', '382', '124199.35', '','0'); -- id=809
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12620155.65', 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='807,808,809' where sellbillid=16;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 129345, 124360, 124360
                    , 124360, 124199.35, 124199.35, 124199.35
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,124360, 116110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+129345, sellCostBuyPrice =sellCostBuyPrice+124360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+124360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+124360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+124199.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+124199.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+124199.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+124360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+116110
                        , returnSellVal = returnSellVal+0, 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 (5, '2026-09-30', 129345, 124360, 124360
                    , 124360, 124199.35, 124199.35, 124199.35
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,124360, 116110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+129345, sellCostBuyPrice =sellCostBuyPrice+124360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+124360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+124360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+124199.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+124199.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+124199.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+124360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+116110
                        , returnSellVal = returnSellVal+0, 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, 129345, 124360, 124360
                    , 124360, 124199.35, 124199.35, 124199.35, 124360, 116110)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+129345, netSellCostBuyPrice = netSellCostBuyPrice+124360
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+124360
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+124360
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+124199.35
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+124199.35
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+124199.35
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+124360
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+116110;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abcfa7c85075 and sellbillId = 16 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:18:31";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:48:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 15:48:31', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1127
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:18:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:48:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:48:43', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1128
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:21:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:51:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:51:40', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1129
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:23:01";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:53:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:53:01', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=1130
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('تطريز واستراس غفران','','26','530','550','550','550','2026-09-30','0','1','0','','0','0','0','0','0','530','530','530','530','530','0','3.77','0','0','.','0','0','0','530','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','530','530','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','530','0','0','0','0','0','0','','','0','0','0','0'); -- id=1354
UPDATE product SET productName = 'تطريز واستراس غفران', productDescription = '', productCatId = '26', productBuyPrice = '530', productSellAllPrice = '550', productSellUnitPrice = '550', productSellHalfPrice = '550', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01354',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '530',lastbuyprice_withDiscount = '530',meanbuyprice = '530',meanbuyprice_withDiscount = '530' , productbuypricereal = '530' , buypricereal_precentage = '0' , buytotal_precentage = '3.77' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='530',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='530',meanbuyprice_withTax='530',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='530',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1354';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1354', '1', '2026-09-30', '1', '0','0135401','550','550','550','530','','0','0','0','0','0','0','0','0','0','0'); -- id=1354
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1354', '1', '0', '1', '2026-09-30'); -- id=1354
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1354', '1', '0', '0', '1354', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1451
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1354, 1,'2026-09-30 15:53:01',1)
                ON DUPLICATE KEY UPDATE productid = 1354, edited = 1, sysdate = '2026-09-30 15:53:01', userid = 1; -- id=2025
UPDATE product SET productName = 'تطريز واستراس غفران', productDescription = '', productCatId = '26', productBuyPrice = '530.00', productSellAllPrice = '550.00', productSellUnitPrice = '550.00', productSellHalfPrice = '550.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01354',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '530',lastbuyprice_withDiscount = '530',meanbuyprice = '530',meanbuyprice_withDiscount = '530' , productbuypricereal = '530' , buypricereal_precentage = '0' , buytotal_precentage = '3.77' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='530',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='530',meanbuyprice_withTax='530',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='530',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1354';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:23:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:53:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:53:03', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1131
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:23:05";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:53:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:53:05', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1132
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:24:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:54:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:54:42', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1133
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:26:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:56:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:56:03', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1134
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:26:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:56:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 15:56:20', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1135
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount,taxfile,fileimg,webStoreType,clientaddress3,tagids,email_verified,email_otp,email_otp_expiry) VALUES ('بني سويف' , '', '01090856430', '', '0', '', '0', '2026-09-30 15:57:32', '2', '0','','0','','-10','0','10000',',','-1','0','.','0','0','.','2026-09-30','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','','','','0','','','0','0',''); -- id=6
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('6', '0', '0', '', ''); -- id=5
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('6','0','0','0','إضافة عميل جديد','6', '0', '2026-09-30 15:57:32', '2', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0','',''); -- id=29
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('بني سويف', 'بني سويف', 'بني سويف', 'بني سويف', '58', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '2', '0', '2026-09-30 15:57:32'); -- id=498
UPDATE client SET clientname = 'بني سويف', clientaddress = '', clientphone = '01090856430', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2026-09-30', userid = '2'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='498',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='0000-00-00 00:00:00' WHERE clientid = '6';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:28:14";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:58:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 15:58:14', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=1136
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 ('06abd06f4e1960', '2026-09-30 15:56:20', '25', '413125.00', '429085', '0', '0', '15960.00',  '15960.00', '0', '15960', '1', '2026-09-30 15:58:14', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=9
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 ('09745', '9', '71', '1247', '84', '190', '15960.00', '0', '', '2026-09-30 15:58:14', '1247','','','0','0','0','0','0',null,'190','15960','0','0','0','0','0','0','0','0','1'); -- id=41
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 15:56:20', 1, 1247, 0, 0
                    , 190, 84, 0, 0, 1, '2026-09-30 15:58:14')
                ON DUPLICATE KEY UPDATE buyprice = 190,
                        buyQuantity =buyQuantity+84, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 15:58:14' ; -- id=46
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1247', '190', '84', '0', 'buyBillController.php', '41', '', '0', '0'); -- id=36
UPDATE product SET  productBuyPrice = "190" WHERE productId = 1247 ;
UPDATE buybilldetail SET  quantitybefore = 79 WHERE buybilldetailid = 41 ;
UPDATE product SET productName = 'موديلات سيفن ار 200', productDescription = '', productCatId = '71', productBuyPrice = '190.00', productSellAllPrice = '200.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09745',type ='0', expireDate = '0' , dailyentryId = '602',isService = '0',isOptic = '0',lastbuyprice = '190',lastbuyprice_withDiscount = '190',meanbuyprice = '188.64',meanbuyprice_withDiscount = '188.64' , productbuypricereal = '180.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='190',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9745',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='190',meanbuyprice_withTax='188.64',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='1',lastbuyprice_withDiscountAndTax='190',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='1',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1247';
UPDATE buybilldetail SET  lastbuyprice = 190 , meanbuyprice = 188.64, lastbuyprice_withDiscount = 190, meanbuyprice_withDiscount = 188.64
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 188.64, lastbuyprice_withDiscountAndTax = 190
                where buybilldetailid = 41;
UPDATE productunit SET proUnitBuyPrice  = 190 * productnumber WHERE productid = 1247;
UPDATE storedetail SET  productquantity = '163', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1247';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1247', '1', '84', '0', '9', 'اضافة فاتورة مشتريات', 'buyBillController.php', '79', '163', '1', '2026-09-30 15:56:20','0','0'); -- id=1452
UPDATE supplier SET  suppliercurrentDebt = '429085',suppliercurrentDebtInCurrency= '429085' , userid = '1', supplierdate = '2026-09-30 15:58:14'   WHERE supplierid = '25';
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 ('25', '413125.00', '15960', '0', 'اضافة فاتورة مشتريات', '9', '429085', '2026-09-30 15:56:20', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','15960','1','413125','15960','429085','0',''); -- id=86
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '15960', '15960', '2026-09-30', '1', '0', '0', '2026-09-30 15:58:14','اضافة فاتورة مشتريات رقم 9','1','0',null,'0','9','buyBillController.php?do=details&id=9'); -- id=810
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('810', '382', '15960', '','0'); -- id=811
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12636115.65', 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 ('810', '444', '15960', '','0'); -- id=810
UPDATE accountstree SET name = 'سيفن ار - مورد', customName = 'سيفن ار - مورد', customNameEn = 'سيفن ار - مورد', nameEn = 'سيفن ار - مورد', parent = '81', accountNature = '1', theValue = '-246990', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 13:17:33' WHERE id = '444';
update buybill set dailyentryid='810,0' where buybillid=9;
COMMIT;
UPDATE product SET overAllAveragePrice = 190 WHERE productId = 1247;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:28:14";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:58:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 15:58:14', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=9'); -- id=1137
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:28:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:58:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 15:58:33', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=1138
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:28:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:58:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 15:58:47', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1139
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:29:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:59:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:59:16', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1140
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:29:37";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:59:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:59:37', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=1141
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('قطن الونش /','','13','0','0','0','0','2026-09-30','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','GS1','','','','0','0','0','0','','0','0','','0','','0','0','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','0','0','0','0','0','0','0','','','0','0','0','0'); -- id=1355
UPDATE product SET productName = 'قطن الونش /', productDescription = '', productCatId = '13', productBuyPrice = '0', productSellAllPrice = '0', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01355',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '',lastbuyprice_withDiscount = '0',meanbuyprice = '',meanbuyprice_withDiscount = '0' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1355';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1355', '1', '2026-09-30', '1', '0','0135501','0','0','0','0','','0','0','0','0','0','0','0','0','0','0'); -- id=1355
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1355', '1', '0', '1', '2026-09-30'); -- id=1355
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1355', '1', '0', '0', '1355', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1453
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1355, 1,'2026-09-30 15:59:37',1)
                ON DUPLICATE KEY UPDATE productid = 1355, edited = 1, sysdate = '2026-09-30 15:59:37', userid = 1; -- id=2026
UPDATE product SET productName = 'قطن الونش /', productDescription = '', productCatId = '13', productBuyPrice = '0.00', productSellAllPrice = '0.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01355',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '',lastbuyprice_withDiscount = '0',meanbuyprice = '',meanbuyprice_withDiscount = '0' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1355';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:29:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:59:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 15:59:38', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1142
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:29:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 15:59:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 15:59:43', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=1143
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:30:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:00:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:00:02', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1144
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:30:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:00:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:00:20', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1145
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:30:27";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:00:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:00:27', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1146
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:30:35";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:00:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:00:35', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1147
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:30:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:00:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:00:48', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1148
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:31:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:01:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:01:04', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1149
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:31:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:01:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:01:08', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1150
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:31:32";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:01:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:01:32', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1151
UPDATE productunit SET proUnitBuyPrice  = 0.00 * productnumber WHERE productid = 1355;
UPDATE product SET productName = 'قطن الونش /', productDescription = '', productCatId = '13', productBuyPrice = '0.00', productSellAllPrice = '0.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01355',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '0.00',meanbuyprice_withDiscount = '0' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1355';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1355, 1,'2026-09-30 16:01:39',1)
                ON DUPLICATE KEY UPDATE productid = 1355, edited = 1, sysdate = '2026-09-30 16:01:39', userid = 1; -- id=2026
UPDATE product SET productName = 'قطن الونش /', productDescription = '', productCatId = '13', productBuyPrice = '0.00', productSellAllPrice = '0.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01355',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '0.00',meanbuyprice_withDiscount = '0' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1355';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1355, 1,'2026-09-30 16:01:42',1)
                ON DUPLICATE KEY UPDATE productid = 1355, edited = 1, sysdate = '2026-09-30 16:01:42', userid = 1; -- id=2026
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:31:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:01:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:01:46', '1', 'edit', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=edit&id=1355'); -- id=1152
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:32:14";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:02:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:02:14', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=update'); -- id=1153
BEGIN;
UPDATE product SET productName = 'قطن الونش /', productDescription = '', productCatId = '13', productBuyPrice = '300', productSellAllPrice = '320', productSellUnitPrice = '320', productSellHalfPrice = '320', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '07909',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0.00',lastbuyprice_withDiscount = '0',meanbuyprice = '0.00',meanbuyprice_withDiscount = '0' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '6.67' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '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='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1355';
UPDATE product SET treeId = 0 WHERE productId = 1355;
UPDATE productunit SET  conditions = 1 WHERE productunitid = 1355;
UPDATE productunit SET unitid = '1', productid = '1355', productnumber = '1.00', productunitdate = '2026-09-30', userid = '1', conditions = '0',proUnitParcode='0135501',proUnitSellAllPrice='320',proUnitSellHalfPrice='320',proUnitSellUnitPrice ='320',proUnitBuyPrice='300',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1355';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1355, 1,'2026-09-30 16:02:14',1)
                ON DUPLICATE KEY UPDATE productid = 1355, edited = 1, sysdate = '2026-09-30 16:02:14', userid = 1; -- id=2026
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:32:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:02:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:02:16', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1154
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:32:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:02:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:02:23', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1155
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:32:32";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:02:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:02:32', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1156
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:32:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:02:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:02:57', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1157
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:33:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:03:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 16:03:16', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1158
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:33:49";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:03:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 16:03:49', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=1159
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 ('06abd089494930', '2026-09-30 16:03:16', '1', '0.00', '0', '0', '0', '0.00',  '0.00', '', '0', '1', '2026-09-30 16:03:49', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=10
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 ('07909', '10', '13', '1355', '11', '0', '0.00', '0', '', '2026-09-30 16:03:49', '1355','','','0','0','0','0','0',null,'0','0','0','0','0','0','0','0','0','0','1'); -- id=42
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 16:03:16', 1, 1355, 0, 0
                    , 0, 11, 0, 0, 1, '2026-09-30 16:03:49')
                ON DUPLICATE KEY UPDATE buyprice = 0,
                        buyQuantity =buyQuantity+11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 16:03:49' ; -- id=47
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1355', '0', '11', '0', 'buyBillController.php', '42', '', '0', '0'); -- id=37
UPDATE product SET  productBuyPrice = "0" WHERE productId = 1355 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 42 ;
UPDATE product SET productName = 'قطن الونش /', productDescription = '', productCatId = '13', productBuyPrice = '0.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '07909',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '0',lastbuyprice_withDiscount = '0',meanbuyprice = '0.00',meanbuyprice_withDiscount = '0' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.67' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='0',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1355';
UPDATE buybilldetail SET  lastbuyprice = 0 , meanbuyprice = 0.00, lastbuyprice_withDiscount = 0, meanbuyprice_withDiscount = 0.00
        
                where buybilldetailid = 42;
UPDATE productunit SET proUnitBuyPrice  = 0 * productnumber WHERE productid = 1355;
UPDATE storedetail SET  productquantity = '11', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1355';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1355', '1', '11', '0', '10', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '11', '1', '2026-09-30 16:03:16','0','0'); -- id=1454
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '0' , userid = '1', supplierdate = '2026-09-30 16:03:49'   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', '0.00', '0', '0', 'اضافة فاتورة مشتريات', '10', '0', '2026-09-30 16:03:16', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=87
update buybill set dailyentryid='0,0' where buybillid=10;
COMMIT;
UPDATE product SET overAllAveragePrice = 0 WHERE productId = 1355;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:33:49";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:03:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 16:03:49', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=10'); -- id=1160
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:33:59";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:03:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-09-30 16:03:59', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/profitreportController.php'); -- id=1161
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:40:49";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:10:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:10:49', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=1162
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:41:44";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:11:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:11:44', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1163
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:50:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:20:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 16:20:23', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1164
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:50:23";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 16:20:23', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1165
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:51:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:21:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:21:00', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1166
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:51:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:21:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:21:08', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1167
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:51:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:21:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:21:18', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1168
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:51:27";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:21:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:21:27', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1169
UPDATE product SET productName = 'بانك 6169 فيلو', productDescription = '', productCatId = '31', productBuyPrice = '615.00', productSellAllPrice = '635.00', productSellUnitPrice = '635.00', productSellHalfPrice = '635.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01352',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '615.00',lastbuyprice_withDiscount = '615',meanbuyprice = '615.00',meanbuyprice_withDiscount = '615' , productbuypricereal = '615.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.25' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='615',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='615',meanbuyprice_withTax='615',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='615',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1352';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1352, 1,'2026-09-30 16:21:39',1)
                ON DUPLICATE KEY UPDATE productid = 1352, edited = 1, sysdate = '2026-09-30 16:21:39', userid = 1; -- id=2017
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:51:49";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:21:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 16:21:49', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=1170
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:51:52";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:21:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:21:52', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1171
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:52:14";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:22:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:22:14', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=1172
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:52:32";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:22:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:22:32', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1173
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:53:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:23:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 16:23:04', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=1174
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:53:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:23:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 16:23:18', '1', 'invReport', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=invReport'); -- id=1175
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:53:32";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:23:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:23:32', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1176
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:53:53";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:23:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 16:23:53', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1177
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:54:06";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:24:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 16:24:06', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=1178
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:54:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:24:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventorybybarcodeController.php', '2026-09-30 16:24:42', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventorybybarcodeController.php'); -- id=1179
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:55:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:25:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyreport.php', '2026-09-30 16:25:23', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyreport.php'); -- id=1180
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:55:34";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:25:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyreport.php', '2026-09-30 16:25:34', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyreport.php'); -- id=1181
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:55:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:25:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 16:25:38', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=add'); -- id=1182
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1352', '1', '12', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '6', '18', '1', '2026-09-30','0','0'); -- id=1455
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7380', '7380', '2026-09-30', '1', '0', '0', '2026-09-30 16:25:38','اعادة جرد للمنتج : (بانك 6169 فيلو/فيلو) فى مخزن : (المخزن الرئيسي) بالكمية : 18','1','0',null,'0','1455','inventoryController.php?do=details&id=1455'); -- id=811
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('811', '382', '7380', '','0'); -- id=812
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12643495.65', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('811', '188', '7380', '','0'); -- id=811
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '-7380', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1355';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1355', '1', '10', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '11', '1', '1', '2026-09-30','0','0'); -- id=1456
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:55:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:25:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventorybybarcodeController.php', '2026-09-30 16:25:39', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventorybybarcodeController.php'); -- id=1183
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:55:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:25:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillreportController.php', '2026-09-30 16:25:50', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillreportController.php'); -- id=1184
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:55:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:25:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillreportController.php', '2026-09-30 16:25:50', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillreportController.php?do=show'); -- id=1185
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:56:34";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:26:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyreport.php', '2026-09-30 16:26:34', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyreport.php'); -- id=1186
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:56:41";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:26:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-30 16:26:41', '1', 'oneSupplier', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1187
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:56:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:26:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventorybybarcodeController.php', '2026-09-30 16:26:45', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventorybybarcodeController.php'); -- id=1188
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:56:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:26:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-30 16:26:50', '1', 'oneSupplier', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1189
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:56:58";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:26:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 16:26:58', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=add'); -- id=1190
UPDATE storedetail SET  productquantity = '12', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1355';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1355', '1', '11', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '1', '12', '1', '2026-09-30','0','0'); -- id=1457
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:57:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:27:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventorybybarcodeController.php', '2026-09-30 16:27:00', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventorybybarcodeController.php'); -- id=1191
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:57:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:27:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 16:27:04', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1192

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abd051f1ee02
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(6,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 16:27:04', '06abd051f1ee02', '6', '0.00', '0', '0', '1', '89395.00', '89395', '89395', '0', '1', '2026-09-30 16:27:04', '', '2', '0', 'بني سويف', '2', '1', '3', '0', 'الشازلي بني سويف', '212' ,'0','','','','','-1','0','0','0','0','0','89395','0','','0','0','89395','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-30','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=17
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '6';
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 ('6','0.00','0','0','اضافة فاتورة مبيعات','17', '0', '2026-09-30 16:27:04', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '89395', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 16:27:04','0','0','',''); -- id=30
UPDATE client SET  inUse = 0 where clientid = 6;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','08354', '17', '13', '784', '19', '360', '6840', '0', '', '0', '2026-09-30 16:27:04', '784', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','360','6840','0','','0','0.00','0','0','0','0'); -- id=45
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 45;
 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 (784, '2026-09-30', 6840, 6460, 6460
                    , 6460, 6460, 6460, 6460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 19, 0, 6460, 6460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6840, sellCostBuyPrice =sellCostBuyPrice+6460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6460
                        , returnSellVal = returnSellVal+0, 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+19
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6840, 6460, 6460
                    , 6460, 6460, 6460, 6460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6460, 6460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6840, sellCostBuyPrice =sellCostBuyPrice+6460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('784', '1', '19', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '38', '19', '2', '2026-09-30 16:27:04','0','0'); -- id=1458
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 ('295','08585', '17', '13', '775', '6', '315', '1890', '0', '', '0', '2026-09-30 16:27:04', '775', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','315','1890','0','','0','0.00','0','0','0','0'); -- id=46
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 295.00
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 295
                where sellbilldetailid = 46;
 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 (775, '2026-09-30', 1890, 1770, 1770
                    , 1770, 1770, 1770, 1770
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1890, sellCostBuyPrice =sellCostBuyPrice+1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1770, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1770
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1770
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1770
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1770
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+6
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1890, 1770, 1770
                    , 1770, 1770, 1770, 1770
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1890, sellCostBuyPrice =sellCostBuyPrice+1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1770, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1770
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1770
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1770
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1770
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '775';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('775', '1', '6', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '20', '2', '2026-09-30 16:27:04','0','0'); -- id=1459
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 ('360','07091', '17', '24', '878', '15', '380', '5700', '0', '', '0', '2026-09-30 16:27:04', '878', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','380','5700','0','','0','0.00','0','0','0','0'); -- id=47
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 47;
 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 (878, '2026-09-30', 5700, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 5400, 5400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5700, sellCostBuyPrice =sellCostBuyPrice+5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5700, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5400, 5400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5700, sellCostBuyPrice =sellCostBuyPrice+5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '878';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('878', '1', '15', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '0', '2', '2026-09-30 16:27:04','0','0'); -- id=1460
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 ('360','04732', '17', '38', '1100', '14', '380', '5320', '0', '', '0', '2026-09-30 16:27:04', '1100', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','380','5320','0','','0','0.00','0','0','0','0'); -- id=48
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 48;
 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 (1100, '2026-09-30', 5320, 5040, 5040
                    , 5040, 5040, 5040, 5040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 14, 0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5320, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5040
                        , returnSellVal = returnSellVal+0, 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+14
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5320, 5040, 5040
                    , 5040, 5040, 5040, 5040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5320, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '1100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1100', '1', '14', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '6', '2', '2026-09-30 16:27:04','0','0'); -- id=1461
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 ('300','08562', '17', '25', '891', '20', '320', '6400', '0', '', '0', '2026-09-30 16:27:04', '891', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','320','6400','0','','0','0.00','0','0','0','0'); -- id=49
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 49;
 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 (891, '2026-09-30', 6400, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6400, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6400, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6400, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, 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 = '25', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '891';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('891', '1', '20', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '25', '2', '2026-09-30 16:27:04','0','0'); -- id=1462
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','07114', '17', '36', '1080', '5', '330', '1650', '0', '', '0', '2026-09-30 16:27:04', '1080', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','330','1650','0','','0','0.00','0','0','0','0'); -- id=50
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 310, lastbuyprice_withDiscountAndTax = 310
                where sellbilldetailid = 50;
 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 (1080, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1550
                        , returnSellVal = returnSellVal+0, 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 = '45', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '1080';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1080', '1', '5', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '50', '45', '2', '2026-09-30 16:27:04','0','0'); -- id=1463
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 38;
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 ('535','01346', '17', '31', '1346', '12', '555', '6660', '0', '', '0', '2026-09-30 16:27:04', '1346', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','38-12,','1','1','0','0','555','6660','0','','0','0.00','0','0','0','0'); -- id=51
UPDATE sellbilldetail SET  lastbuyprice = 535.00 , meanbuyprice = 535.00, lastbuyprice_withDiscount = 535.00, meanbuyprice_withDiscount = 535.00
        , lastbuyprice_withTax = 535, meanbuyprice_withTax = 535, lastbuyprice_withDiscountAndTax = 535
                where sellbilldetailid = 51;
 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 (1346, '2026-09-30', 6660, 6420, 6420
                    , 6420, 6420, 6420, 6420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 6420, 6420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6660, sellCostBuyPrice =sellCostBuyPrice+6420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6660, 6420, 6420
                    , 6420, 6420, 6420, 6420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6420, 6420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6660, sellCostBuyPrice =sellCostBuyPrice+6420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '1346';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1346', '1', '12', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '24', '2', '2026-09-30 16:27:04','0','0'); -- id=1464
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 44;
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 ('615','01352', '17', '31', '1352', '18', '635', '11430', '0', '', '0', '2026-09-30 16:27:04', '1352', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','44-6,','1','1','0','0','635','11430','0','','0','0.00','0','0','0','0'); -- id=52
UPDATE sellbilldetail SET  lastbuyprice = 615.00 , meanbuyprice = 615.00, lastbuyprice_withDiscount = 615.00, meanbuyprice_withDiscount = 615.00
        , lastbuyprice_withTax = 615, meanbuyprice_withTax = 615, lastbuyprice_withDiscountAndTax = 615
                where sellbilldetailid = 52;
 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 (1352, '2026-09-30', 11430, 11070, 11070
                    , 11070, 11070, 11070, 11070
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 11070, 11070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11430, sellCostBuyPrice =sellCostBuyPrice+11070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11070, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11070
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11070
                        , returnSellVal = returnSellVal+0, 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+18
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 11430, 11070, 11070
                    , 11070, 11070, 11070, 11070
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11070, 11070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11430, sellCostBuyPrice =sellCostBuyPrice+11070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11070, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11070
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11070
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '1352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1352', '1', '18', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '0', '2', '2026-09-30 16:27:04','0','0'); -- id=1465
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','07415', '17', '24', '873', '5', '360', '1800', '0', '', '0', '2026-09-30 16:27:04', '873', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','360','1800','0','','0','0.00','0','0','0','0'); -- id=53
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 53;
 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 (873, '2026-09-30', 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '873';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('873', '1', '5', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '2', '2026-09-30 16:27:04','0','0'); -- id=1466
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 ('345','08528', '17', '24', '879', '5', '365', '1825', '0', '', '0', '2026-09-30 16:27:04', '879', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','365','1825','0','','0','0.00','0','0','0','0'); -- id=54
UPDATE sellbilldetail SET  lastbuyprice = 345.00 , meanbuyprice = 345.00, lastbuyprice_withDiscount = 345.00, meanbuyprice_withDiscount = 345.00
        , lastbuyprice_withTax = 345, meanbuyprice_withTax = 345, lastbuyprice_withDiscountAndTax = 345
                where sellbilldetailid = 54;
 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 (879, '2026-09-30', 1825, 1725, 1725
                    , 1725, 1725, 1725, 1725
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1725, 1725, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1825, sellCostBuyPrice =sellCostBuyPrice+1725
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1725, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1725
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1725, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1725
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1725
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1725
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1725
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1825, 1725, 1725
                    , 1725, 1725, 1725, 1725
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1725, 1725, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1825, sellCostBuyPrice =sellCostBuyPrice+1725
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1725, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1725
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1725, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1725
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1725
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1725
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1725
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '879';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('879', '1', '5', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '4', '2', '2026-09-30 16:27:04','0','0'); -- id=1467
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('415','08785', '17', '38', '1097', '15', '435', '6525', '0', '', '0', '2026-09-30 16:27:04', '1097', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','435','6525','0','','0','0.00','0','0','0','0'); -- id=55
UPDATE sellbilldetail SET  lastbuyprice = 415.00 , meanbuyprice = 415.00, lastbuyprice_withDiscount = 415.00, meanbuyprice_withDiscount = 415.00
        , lastbuyprice_withTax = 415, meanbuyprice_withTax = 415, lastbuyprice_withDiscountAndTax = 415
                where sellbilldetailid = 55;
 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 (1097, '2026-09-30', 6525, 6225, 6225
                    , 6225, 6225, 6225, 6225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 6225, 6225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6525, sellCostBuyPrice =sellCostBuyPrice+6225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6225
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6525, 6225, 6225
                    , 6225, 6225, 6225, 6225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6225, 6225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6525, sellCostBuyPrice =sellCostBuyPrice+6225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6225
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '1097';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1097', '1', '15', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '15', '2', '2026-09-30 16:27:04','0','0'); -- id=1468
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 37;
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 ('570','01345', '17', '31', '1345', '6', '590', '3540', '0', '', '0', '2026-09-30 16:27:04', '1345', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','37-6,','1','1','0','0','590','3540','0','','0','0.00','0','0','0','0'); -- id=56
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 56;
 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 (1345, '2026-09-30', 3540, 3420, 3420
                    , 3420, 3420, 3420, 3420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3420, 3420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3540, sellCostBuyPrice =sellCostBuyPrice+3420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+6
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3540, 3420, 3420
                    , 3420, 3420, 3420, 3420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3420, 3420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3540, sellCostBuyPrice =sellCostBuyPrice+3420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3420
                        , returnSellVal = returnSellVal+0, 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 = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '1345';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1345', '1', '6', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '12', '2', '2026-09-30 16:27:04','0','0'); -- id=1469
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','07426', '17', '30', '972', '20', '470', '9400', '0', '', '0', '2026-09-30 16:27:04', '972', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','470','9400','0','','0','0.00','0','0','0','0'); -- id=57
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 57;
 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 (972, '2026-09-30', 9400, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 9000, 9000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9400, sellCostBuyPrice =sellCostBuyPrice+9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9400, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9000, 9000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9400, sellCostBuyPrice =sellCostBuyPrice+9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '55', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '972';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('972', '1', '20', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '75', '55', '2', '2026-09-30 16:27:04','0','0'); -- id=1470
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','09633', '17', '24', '886', '15', '380', '5700', '0', '', '0', '2026-09-30 16:27:04', '886', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','380','5700','0','','0','0.00','0','0','0','0'); -- id=58
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 58;
 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 (886, '2026-09-30', 5700, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 5400, 5400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5700, sellCostBuyPrice =sellCostBuyPrice+5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5700, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5400, 5400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5700, sellCostBuyPrice =sellCostBuyPrice+5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '886';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('886', '1', '15', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '35', '20', '2', '2026-09-30 16:27:04','0','0'); -- id=1471
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('355','09632', '17', '24', '885', '5', '375', '1875', '0', '', '0', '2026-09-30 16:27:04', '885', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','375','1875','0','','0','0.00','0','0','0','0'); -- id=59
UPDATE sellbilldetail SET  lastbuyprice = 355.00 , meanbuyprice = 355.00, lastbuyprice_withDiscount = 355.00, meanbuyprice_withDiscount = 355.00
        , lastbuyprice_withTax = 355, meanbuyprice_withTax = 355, lastbuyprice_withDiscountAndTax = 355
                where sellbilldetailid = 59;
 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 (885, '2026-09-30', 1875, 1775, 1775
                    , 1775, 1775, 1775, 1775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1775, 1775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1875, sellCostBuyPrice =sellCostBuyPrice+1775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1775
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1875, 1775, 1775
                    , 1775, 1775, 1775, 1775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1775, 1775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1875, sellCostBuyPrice =sellCostBuyPrice+1775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1775
                        , returnSellVal = returnSellVal+0, 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 = '80', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '885';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('885', '1', '5', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '85', '80', '2', '2026-09-30 16:27:04','0','0'); -- id=1472
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('430','09511', '17', '19', '841', '20', '450', '9000', '0', '', '0', '2026-09-30 16:27:04', '841', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','450','9000','0','','0','0.00','0','0','0','0'); -- id=60
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 60;
 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 (841, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, 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 = '50', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '841';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('841', '1', '20', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '70', '50', '2', '2026-09-30 16:27:04','0','0'); -- id=1473
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+11 where id = 47;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','07909', '17', '13', '1355', '12', '320', '3840', '0', '', '0', '2026-09-30 16:27:04', '1355', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','47-11,','1','1','0','0','320','3840','0','','0','0.00','0','0','0','0'); -- id=61
UPDATE sellbilldetail SET  lastbuyprice = 0.00 , meanbuyprice = 0.00, lastbuyprice_withDiscount = 0.00, meanbuyprice_withDiscount = 0.00
        
                where sellbilldetailid = 61;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1355, '2026-09-30', 3840, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3840, 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+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3840, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3840, 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+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-09-30 16:27:04' WHERE storedetailid = '1355';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1355', '1', '12', '1', '17', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '0', '2', '2026-09-30 16:27:04','0','0'); -- id=1474
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '259650',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('170255','89395', '0', '2', 'اضافة فاتورة مبيعات', '17', '259650', '2026-09-30 16:27:04', '2',  'sellbillController.php','6','','0'); -- id=29
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '89395', '89395', '2026-09-30', '2', '0', '0', '2026-09-30 16:27:04','اضافة فاتورة مبيعات رقم 17','1','0',null,'0','17','sellbillController.php?do=showDetail&sellbillid=17'); -- id=812
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('812', '498', '89395', '','0'); -- id=813
UPDATE accountstree SET name = 'بني سويف', customName = 'بني سويف', customNameEn = 'بني سويف', nameEn = 'بني سويف', parent = '58', accountNature = '0', theValue = '89395', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:57:32' WHERE id = '498';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('812', '143', '89395', '','0'); -- id=812
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '279900', 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 ( '89395', '89395', '2026-09-30', '2', '0', '0', '2026-09-30 16:27:04','اضافة فاتورة مبيعات رقم 17 - تحصيل الفاتورة من العميل','1','0',null,'0','17','sellbillController.php?do=showDetail&sellbillid=17'); -- id=813
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('813', '419', '89395', '','0'); -- id=814
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '259650', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('813', '498', '89395', '','0'); -- id=813
UPDATE accountstree SET name = 'بني سويف', customName = 'بني سويف', customNameEn = 'بني سويف', nameEn = 'بني سويف', parent = '58', accountNature = '0', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:57:32' WHERE id = '498';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '81555', '81555', '2026-09-30', '2', '0', '0', '2026-09-30 16:27:04','اضافة فاتورة مبيعات رقم 17 - صرف البضاعة من المخزن','1','0',null,'0','17','sellbillController.php?do=showDetail&sellbillid=17'); -- id=814
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('814', '402', '81555', '','0'); -- id=815
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '272519.35', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('814', '382', '81555', '','0'); -- id=814
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12561940.65', 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='812,813,814' where sellbillid=17;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 89395, 81555, 81555
                    , 81555, 81555, 81555, 81555
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,81555, 81555, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+89395, sellCostBuyPrice =sellCostBuyPrice+81555
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+81555, sellCostMeanBuyPrice = sellCostMeanBuyPrice+81555
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+81555, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+81555
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+81555
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+81555
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+81555
                        , returnSellVal = returnSellVal+0, 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 (6, '2026-09-30', 89395, 81555, 81555
                    , 81555, 81555, 81555, 81555
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,81555, 81555, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+89395, sellCostBuyPrice =sellCostBuyPrice+81555
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+81555, sellCostMeanBuyPrice = sellCostMeanBuyPrice+81555
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+81555, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+81555
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+81555
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+81555
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+81555
                        , returnSellVal = returnSellVal+0, 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, 89395, 81555, 81555
                    , 81555, 81555, 81555, 81555, 81555, 81555)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+89395, netSellCostBuyPrice = netSellCostBuyPrice+81555
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+81555
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+81555
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+81555
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+81555
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+81555
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+81555
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+81555;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abd051f1ee02 and sellbillId = 17 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:57:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:27:04", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 16:27:04', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1193
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:57:29";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:27:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-30 16:27:29', '1', 'oneSupplier', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1194
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:57:41";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:27:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-09-30 16:27:41', '1', 'oneSupplier', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=1195
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:57:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:27:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-09-30 16:27:45', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php'); -- id=1196
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:58:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:28:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-09-30 16:28:03', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php?do=show'); -- id=1197
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:58:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:28:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 16:28:04', '1', 'invReport', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=invReport'); -- id=1198
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:58:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:28:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillreportController.php', '2026-09-30 16:28:17', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillreportController.php'); -- id=1199
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:58:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:28:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillreportController.php', '2026-09-30 16:28:17', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillreportController.php?do=show'); -- id=1200
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:58:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:28:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillreportController.php', '2026-09-30 16:28:46', '1', 'details', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillreportController.php?do=details&id=8'); -- id=1201
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:59:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:29:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillreportController.php', '2026-09-30 16:29:02', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillreportController.php?do=show'); -- id=1202
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:59:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:29:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:29:40', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=1203
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 12:59:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:29:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-09-30 16:29:55', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php'); -- id=1204
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:00:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:30:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-09-30 16:30:09', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php?do=show'); -- id=1205
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:00:30";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:30:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-09-30 16:30:30', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=1206
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:00:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:30:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:30:33', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1207
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:01:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:31:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productserailreportController.php', '2026-09-30 16:31:04', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productserailreportController.php?do=show'); -- id=1208
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:03:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:33:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productmovmentController.php', '2026-09-30 16:33:55', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productmovmentController.php'); -- id=1209
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:04:15";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:34:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productmovmentController.php', '2026-09-30 16:34:15', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productmovmentController.php?do=show'); -- id=1210
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:07:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:37:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 16:37:43', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=1211
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:08:19";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:38:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 16:38:19', '1', 'add2', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=1212
INSERT INTO productcat (productCatName, productCatDate, productCatDescription, productCatParent, userId, conditions, selldiscount, buydiscount, discounttype,isOptic , buytotal , buyhalf , buypart ,buypricereal,opticServices,logo,inMenu,stopNegativeSale,catExcelid,webApiId,obygyInvestigationCatId,price4,price5,price6,price7,price8,price9,price10,price11,price12,price13) VALUES ('سفنتي','2026-09-30','','85', '1','0', '0', '0', '-1', '0', '0', '0', '0','0','','.','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); -- id=88
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (88, 1,'2026-09-30 16:38:19',1)
                ON DUPLICATE KEY UPDATE catid = 88, edited = 1, sysdate = '2026-09-30 16:38:19', userid = 1; -- id=88
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '88', '1', '2026-09-30', '1', '0'); -- id=4
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:08:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:38:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 16:38:20', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=1213
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:08:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:38:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 16:38:21', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=1214
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:08:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:38:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:38:33', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1215
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:11:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:41:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:41:20', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=1216
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('تريكو سفنتي 420','','88','400','420','420','420','2026-09-30','0','1','0','','0','0','0','0','0','400','400','400','400','400','0','5','0','0','.','0','0','0','400','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','400','400','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','400','0','0','0','0','0','0','','','0','0','0','0'); -- id=1356
UPDATE product SET productName = 'تريكو سفنتي 420', productDescription = '', productCatId = '88', productBuyPrice = '400', productSellAllPrice = '420', productSellUnitPrice = '420', productSellHalfPrice = '420', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01356',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '400',meanbuyprice = '400',meanbuyprice_withDiscount = '400' , productbuypricereal = '400' , buypricereal_precentage = '0' , buytotal_precentage = '5' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='400',meanbuyprice_withTax='400',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='400',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1356';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1356', '1.00', '2026-09-30', '1', '0','0135601','420','420','420','400','','0','0','0','0','0','0','0','0','0','0'); -- id=1356
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1356', '1', '176', '1', '2026-09-30'); -- id=1356
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '1', '176', '0', '1356', 'إضافة منتج', 'productController.php', '0', '176', '1', '2026-09-30','0','0'); -- id=1475
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1356, 1,'2026-09-30 16:41:20',1)
                ON DUPLICATE KEY UPDATE productid = 1356, edited = 1, sysdate = '2026-09-30 16:41:20', userid = 1; -- id=2031
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '70400', '70400', '2026-09-30', '1', '0', '0', '2026-09-30 16:41:20','إضافة منتج تريكو سفنتي 420 الكمية 176','1','0','-1','0','1356','productController.php?do=edit&id=1356'); -- id=815
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('815', '382', '70400', '','0'); -- id=816
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12632340.65', 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 ('815', '121', '70400', '','0'); -- id=815
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '-2911873.55', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
UPDATE product SET productName = 'تريكو سفنتي 420', productDescription = '', productCatId = '88', productBuyPrice = '400.00', productSellAllPrice = '420.00', productSellUnitPrice = '420.00', productSellHalfPrice = '420.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01356',type ='0', expireDate = '0' , dailyentryId = '815',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '400',meanbuyprice = '400',meanbuyprice_withDiscount = '400' , productbuypricereal = '400' , buypricereal_precentage = '0' , buytotal_precentage = '5' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='400',meanbuyprice_withTax='400',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='400',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1356';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('تريكو سفنتي 430','','88','410','430','430','430','2026-09-30','0','1','0','','0','0','0','0','0','410','410','410','410','410','0','4.88','0','0','.','0','0','0','410','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','410','410','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','410','0','0','0','0','0','0','','','0','0','0','0'); -- id=1357
UPDATE product SET productName = 'تريكو سفنتي 430', productDescription = '', productCatId = '88', productBuyPrice = '410', productSellAllPrice = '430', productSellUnitPrice = '430', productSellHalfPrice = '430', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01357',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410' , buypricereal_precentage = '0' , buytotal_precentage = '4.88' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='410',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='410',meanbuyprice_withTax='410',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='410',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1357';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1357', '1.00', '2026-09-30', '1', '0','0135701','430','430','430','410','','0','0','0','0','0','0','0','0','0','0'); -- id=1357
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1357', '1', '72', '1', '2026-09-30'); -- id=1357
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1357', '1', '72', '0', '1357', 'إضافة منتج', 'productController.php', '0', '72', '1', '2026-09-30','0','0'); -- id=1476
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1357, 1,'2026-09-30 16:41:20',1)
                ON DUPLICATE KEY UPDATE productid = 1357, edited = 1, sysdate = '2026-09-30 16:41:20', userid = 1; -- id=2032
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '29520', '29520', '2026-09-30', '1', '0', '0', '2026-09-30 16:41:20','إضافة منتج تريكو سفنتي 430 الكمية 72','1','0','-1','0','1357','productController.php?do=edit&id=1357'); -- id=816
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('816', '382', '29520', '','0'); -- id=817
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12661860.65', 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 ('816', '121', '29520', '','0'); -- id=816
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '-2882353.55', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
UPDATE product SET productName = 'تريكو سفنتي 430', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '430.00', productSellUnitPrice = '430.00', productSellHalfPrice = '430.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01357',type ='0', expireDate = '0' , dailyentryId = '816',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410' , buypricereal_precentage = '0' , buytotal_precentage = '4.88' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='410',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='410',meanbuyprice_withTax='410',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='410',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1357';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('تريكو سفنتي 400','','88','380','400','400','400','2026-09-30','0','1','0','','0','0','0','0','0','380','380','380','380','380','0','5.26','0','0','.','0','0','0','380','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','380','380','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','380','0','0','0','0','0','0','','','0','0','0','0'); -- id=1358
UPDATE product SET productName = 'تريكو سفنتي 400', productDescription = '', productCatId = '88', productBuyPrice = '380', productSellAllPrice = '400', productSellUnitPrice = '400', productSellHalfPrice = '400', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01358',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380' , buypricereal_precentage = '0' , buytotal_precentage = '5.26' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='380',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1358';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1358', '1.00', '2026-09-30', '1', '0','0135801','400','400','400','380','','0','0','0','0','0','0','0','0','0','0'); -- id=1358
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1358', '1', '48', '1', '2026-09-30'); -- id=1358
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1358', '1', '48', '0', '1358', 'إضافة منتج', 'productController.php', '0', '48', '1', '2026-09-30','0','0'); -- id=1477
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1358, 1,'2026-09-30 16:41:20',1)
                ON DUPLICATE KEY UPDATE productid = 1358, edited = 1, sysdate = '2026-09-30 16:41:20', userid = 1; -- id=2033
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '18240', '18240', '2026-09-30', '1', '0', '0', '2026-09-30 16:41:20','إضافة منتج تريكو سفنتي 400 الكمية 48','1','0','-1','0','1358','productController.php?do=edit&id=1358'); -- id=817
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('817', '382', '18240', '','0'); -- id=818
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12680100.65', 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 ('817', '121', '18240', '','0'); -- id=817
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '-2864113.55', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
UPDATE product SET productName = 'تريكو سفنتي 400', productDescription = '', productCatId = '88', productBuyPrice = '380.00', productSellAllPrice = '400.00', productSellUnitPrice = '400.00', productSellHalfPrice = '400.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01358',type ='0', expireDate = '0' , dailyentryId = '817',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380' , buypricereal_precentage = '0' , buytotal_precentage = '5.26' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='380',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1358';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:11:22";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:41:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:41:22', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1217
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:11:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:41:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:41:28', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1218
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:12:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:42:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:42:42', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=1219
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('تريكو سفنتي 390','','88','370','390','390','390','2026-09-30','0','1','0','','0','0','0','0','0','370','370','370','370','370','0','5.41','0','0','.','0','0','0','370','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','370','370','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','370','0','0','0','0','0','0','','','0','0','0','0'); -- id=1359
UPDATE product SET productName = 'تريكو سفنتي 390', productDescription = '', productCatId = '88', productBuyPrice = '370', productSellAllPrice = '390', productSellUnitPrice = '390', productSellHalfPrice = '390', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01359',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '370',meanbuyprice = '370',meanbuyprice_withDiscount = '370' , productbuypricereal = '370' , buypricereal_precentage = '0' , buytotal_precentage = '5.41' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='370',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='370',meanbuyprice_withTax='370',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='370',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1359';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1359', '1.00', '2026-09-30', '1', '0','0135901','390','390','390','370','','0','0','0','0','0','0','0','0','0','0'); -- id=1359
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1359', '1', '64', '1', '2026-09-30'); -- id=1359
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1359', '1', '64', '0', '1359', 'إضافة منتج', 'productController.php', '0', '64', '1', '2026-09-30','0','0'); -- id=1478
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1359, 1,'2026-09-30 16:42:42',1)
                ON DUPLICATE KEY UPDATE productid = 1359, edited = 1, sysdate = '2026-09-30 16:42:42', userid = 1; -- id=2034
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '23680', '23680', '2026-09-30', '1', '0', '0', '2026-09-30 16:42:42','إضافة منتج تريكو سفنتي 390 الكمية 64','1','0','-1','0','1359','productController.php?do=edit&id=1359'); -- id=818
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('818', '382', '23680', '','0'); -- id=819
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12703780.65', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('818', '121', '23680', '','0'); -- id=818
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '-2840433.55', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
UPDATE product SET productName = 'تريكو سفنتي 390', productDescription = '', productCatId = '88', productBuyPrice = '370.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01359',type ='0', expireDate = '0' , dailyentryId = '818',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '370',meanbuyprice = '370',meanbuyprice_withDiscount = '370' , productbuypricereal = '370' , buypricereal_precentage = '0' , buytotal_precentage = '5.41' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='370',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='370',meanbuyprice_withTax='370',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='370',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1359';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:12:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:42:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:42:43', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1220
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:12:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:42:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 16:42:48', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=1221
INSERT INTO supplier (suppliername, supplieraddress, supplierphone, suppliercurrentDebt, supplierdetails, conditions, userid, supplierdate, dailyentryid, category_id, typesupplier_id,linkedClientId,inUse,suppliercode,goverareaid,namepayeecheck,suppliermobile,warrantyOfficer,warrantymobile,sellername,sellermobile,taxnumber,supplierTypeForTree,treeId,sullpierCurrencyid,suppliercurrentDebtInCurrency,webApiId,shippingDiscountPer) VALUES ('سفنتي', '', '', '', '', '0', '1', '2026-09-30 16:43:09', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=75
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 ('75', '0', '', '0', 'إضافة مورد جديد', '75', '', '2026-09-30 16:43:09', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=88
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('سفنتي', 'سفنتي', 'سفنتي', 'سفنتي', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-09-30 16:43:09'); -- id=499
UPDATE supplier SET suppliername = 'سفنتي', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-09-30', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='499',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '75';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:15:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:45:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 16:45:33', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=1222
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 ('06abd11d8c0c02', '2026-09-30 16:42:48', '75', '0.00', '151440', '0', '0', '151440.00',  '151440.00', '0', '151440', '1', '2026-09-30 16:45:33', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=11
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 ('01356', '11', '88', '1356', '200', '400', '80000.00', '0', '', '2026-09-30 16:45:33', '1356','','','0','0','0','0','0',null,'400','80000','0','0','0','0','0','0','0','0','1'); -- id=43
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 16:42:48', 1, 1356, 0, 0
                    , 400, 200, 0, 0, 1, '2026-09-30 16:45:33')
                ON DUPLICATE KEY UPDATE buyprice = 400,
                        buyQuantity =buyQuantity+200, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 16:45:33' ; -- id=48
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1356', '400', '200', '0', 'buyBillController.php', '43', '', '0', '0'); -- id=38
UPDATE product SET  productBuyPrice = "400" WHERE productId = 1356 ;
UPDATE buybilldetail SET  quantitybefore = 176 WHERE buybilldetailid = 43 ;
UPDATE product SET productName = 'تريكو سفنتي 420', productDescription = '', productCatId = '88', productBuyPrice = '400.00', productSellAllPrice = '420.00', productSellUnitPrice = '420.00', productSellHalfPrice = '420.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01356',type ='0', expireDate = '0' , dailyentryId = '815',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '400',meanbuyprice = '400',meanbuyprice_withDiscount = '400' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',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='400',meanbuyprice_withTax='400',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='400',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1356';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 400, meanbuyprice_withDiscount = 400
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where buybilldetailid = 43;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 1356;
UPDATE storedetail SET  productquantity = '376', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1356';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '1', '200', '0', '11', 'اضافة فاتورة مشتريات', 'buyBillController.php', '176', '376', '1', '2026-09-30 16:42:48','0','0'); -- id=1479
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 ('01357', '11', '88', '1357', '72', '410', '29520.00', '0', '', '2026-09-30 16:45:33', '1357','','','0','0','0','0','0',null,'410','29520','0','0','0','0','0','0','0','0','1'); -- id=44
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 16:42:48', 1, 1357, 0, 0
                    , 410, 72, 0, 0, 1, '2026-09-30 16:45:33')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 16:45:33' ; -- id=49
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1357', '410', '72', '0', 'buyBillController.php', '44', '', '0', '0'); -- id=39
UPDATE product SET  productBuyPrice = "410" WHERE productId = 1357 ;
UPDATE buybilldetail SET  quantitybefore = 72 WHERE buybilldetailid = 44 ;
UPDATE product SET productName = 'تريكو سفنتي 430', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '430.00', productSellUnitPrice = '430.00', productSellHalfPrice = '430.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01357',type ='0', expireDate = '0' , dailyentryId = '816',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.88' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='410',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='410',meanbuyprice_withTax='410',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='410',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1357';
UPDATE buybilldetail SET  lastbuyprice = 410 , meanbuyprice = 410, lastbuyprice_withDiscount = 410, meanbuyprice_withDiscount = 410
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where buybilldetailid = 44;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1357;
UPDATE storedetail SET  productquantity = '144', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1357';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1357', '1', '72', '0', '11', 'اضافة فاتورة مشتريات', 'buyBillController.php', '72', '144', '1', '2026-09-30 16:42:48','0','0'); -- id=1480
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 ('01358', '11', '88', '1358', '48', '380', '18240.00', '0', '', '2026-09-30 16:45:33', '1358','','','0','0','0','0','0',null,'380','18240','0','0','0','0','0','0','0','0','1'); -- id=45
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 16:42:48', 1, 1358, 0, 0
                    , 380, 48, 0, 0, 1, '2026-09-30 16:45:33')
                ON DUPLICATE KEY UPDATE buyprice = 380,
                        buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 16:45:33' ; -- id=50
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1358', '380', '48', '0', 'buyBillController.php', '45', '', '0', '0'); -- id=40
UPDATE product SET  productBuyPrice = "380" WHERE productId = 1358 ;
UPDATE buybilldetail SET  quantitybefore = 48 WHERE buybilldetailid = 45 ;
UPDATE product SET productName = 'تريكو سفنتي 400', productDescription = '', productCatId = '88', productBuyPrice = '380.00', productSellAllPrice = '400.00', productSellUnitPrice = '400.00', productSellHalfPrice = '400.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01358',type ='0', expireDate = '0' , dailyentryId = '817',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.26' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',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='380',meanbuyprice_withTax='380',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1358';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 380, lastbuyprice_withDiscount = 380, meanbuyprice_withDiscount = 380
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where buybilldetailid = 45;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 1358;
UPDATE storedetail SET  productquantity = '96', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1358';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1358', '1', '48', '0', '11', 'اضافة فاتورة مشتريات', 'buyBillController.php', '48', '96', '1', '2026-09-30 16:42:48','0','0'); -- id=1481
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 ('01359', '11', '88', '1359', '64', '370', '23680.00', '0', '', '2026-09-30 16:45:33', '1359','','','0','0','0','0','0',null,'370','23680','0','0','0','0','0','0','0','0','1'); -- id=46
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30 16:42:48', 1, 1359, 0, 0
                    , 370, 64, 0, 0, 1, '2026-09-30 16:45:33')
                ON DUPLICATE KEY UPDATE buyprice = 370,
                        buyQuantity =buyQuantity+64, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-09-30 16:45:33' ; -- id=51
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1359', '370', '64', '0', 'buyBillController.php', '46', '', '0', '0'); -- id=41
UPDATE product SET  productBuyPrice = "370" WHERE productId = 1359 ;
UPDATE buybilldetail SET  quantitybefore = 64 WHERE buybilldetailid = 46 ;
UPDATE product SET productName = 'تريكو سفنتي 390', productDescription = '', productCatId = '88', productBuyPrice = '370.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01359',type ='0', expireDate = '0' , dailyentryId = '818',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '370',meanbuyprice = '370',meanbuyprice_withDiscount = '370' , productbuypricereal = '370.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.41' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='370',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='370',meanbuyprice_withTax='370',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='370',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1359';
UPDATE buybilldetail SET  lastbuyprice = 370 , meanbuyprice = 370, lastbuyprice_withDiscount = 370, meanbuyprice_withDiscount = 370
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 370
                where buybilldetailid = 46;
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 1359;
UPDATE storedetail SET  productquantity = '128', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1359';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1359', '1', '64', '0', '11', 'اضافة فاتورة مشتريات', 'buyBillController.php', '64', '128', '1', '2026-09-30 16:42:48','0','0'); -- id=1482
UPDATE supplier SET  suppliercurrentDebt = '151440',suppliercurrentDebtInCurrency= '151440' , userid = '1', supplierdate = '2026-09-30 16:45:33'   WHERE supplierid = '75';
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 ('75', '0.00', '151440', '0', 'اضافة فاتورة مشتريات', '11', '151440', '2026-09-30 16:42:48', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','151440','1','0','151440','151440','0',''); -- id=89
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '151440', '151440', '2026-09-30', '1', '0', '0', '2026-09-30 16:45:33','اضافة فاتورة مشتريات رقم 11','1','0',null,'0','11','buyBillController.php?do=details&id=11'); -- id=819
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('819', '382', '151440', '','0'); -- id=820
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12855220.65', 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 ('819', '499', '151440', '','0'); -- id=819
UPDATE accountstree SET name = 'سفنتي', customName = 'سفنتي', customNameEn = 'سفنتي', nameEn = 'سفنتي', parent = '81', accountNature = '1', theValue = '151440', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 16:43:09' WHERE id = '499';
update buybill set dailyentryid='819,0' where buybillid=11;
COMMIT;
UPDATE product SET overAllAveragePrice = 400 WHERE productId = 1356;UPDATE product SET overAllAveragePrice = 410 WHERE productId = 1357;UPDATE product SET overAllAveragePrice = 380 WHERE productId = 1358;UPDATE product SET overAllAveragePrice = 370 WHERE productId = 1359;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:15:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:45:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 16:45:33', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=11'); -- id=1223
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:15:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:45:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:45:39', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=1224
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:15:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:45:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:45:50', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1225
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:16:01";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:46:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:46:01', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=1226
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:16:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:46:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:46:28', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1227
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:16:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:46:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:46:36', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1228
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:16:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:46:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:46:50', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1229
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:17:10";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:47:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-09-30 16:47:10', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php'); -- id=1230
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:18:35";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:48:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:48:35', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1231
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:18:37";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:48:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:48:37', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=1232
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:18:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:48:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:48:55', '1', 'edit', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=edit&id=1356'); -- id=1233
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:21:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:51:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 16:51:11', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=1234
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:23:35";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:53:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 16:53:35', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=1235
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:24:25";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:54:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 16:54:25', '1', 'autosave', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=1236
UPDATE storedetail SET  productquantity = '200', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1356';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '1', '176', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '376', '200', '1', '2026-09-30','0','0'); -- id=1483
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '70400', '70400', '2026-09-30', '1', '0', '0', '2026-09-30 16:54:25','اعادة جرد للمنتج : (تريكو سفنتي 420/سفنتي) فى مخزن : (المخزن الرئيسي) بالكمية : 200','1','0',null,'0','1483','inventoryController.php?do=details&id=1483'); -- id=820
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('820', '188', '70400', '','0'); -- id=821
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '63020', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('820', '382', '70400', '','0'); -- id=820
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12784820.65', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:24:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:54:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 16:54:40', '1', 'autosave', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=1237
UPDATE storedetail SET  productquantity = '200', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1356';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '1', '200', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية لم يتغير', 'inventoryController.php', '200', '200', '1', '2026-09-30','0','0'); -- id=1484
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:25:22";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:55:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 16:55:22', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1238

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abd0e28c9ef8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 16:55:22', '06abd0e28c9ef8', '1', '0.00', '0', '0', '1', '1550.00', '1550', '1550', '0', '1', '2026-09-30 16:55:22', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '7' ,'0','','','','','-1','0','0','0','0','0','1550','0','','0','0','1550','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-30','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=18
UPDATE client SET  clientdebt = '0', userid = '2' 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','اضافة فاتورة مبيعات','18', '0', '2026-09-30 16:55:22', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1550', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 16:55:22','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 ('230','08756', '18', '54', '1199', '3', '250', '750', '0', '', '0', '2026-09-30 16:55:22', '1199', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','250','750','0','','0','0.00','0','0','0','0'); -- id=62
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 62;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1199, '2026-09-30', 750, 690, 690
                    , 690, 690, 690, 690
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 690, 690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+690
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+690
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+690
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 750, 690, 690
                    , 690, 690, 690, 690
                    , 0, 0, 0, 0
                    , 0, 0, 0, 690, 690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+690
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+690
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+690
                        , returnSellVal = returnSellVal+0, 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 = '45', userid = '2', storedetaildate = '2026-09-30 16:55:22' WHERE storedetailid = '1199';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1199', '1', '3', '1', '18', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '45', '2', '2026-09-30 16:55:22','0','0'); -- id=1485
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 46;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','09745', '18', '71', '1247', '4', '200', '800', '0', '', '0', '2026-09-30 16:55:22', '1247', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','46-4,','1','1','0','0','200','800','0','','0','0.00','0','0','0','0'); -- id=63
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 188.64, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 188.64
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 188.64, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 63;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1247, '2026-09-30', 800, 760, 760
                    , 754.56, 760, 754.56, 760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 760, 754.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+800, sellCostBuyPrice =sellCostBuyPrice+760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+754.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+754.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+754.56
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 800, 760, 760
                    , 754.56, 760, 754.56, 760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 760, 754.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+800, sellCostBuyPrice =sellCostBuyPrice+760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+754.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+754.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+754.56
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '159', userid = '2', storedetaildate = '2026-09-30 16:55:22' WHERE storedetailid = '1247';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1247', '1', '4', '1', '18', 'اضافة فاتورة مبيعات', 'sellbillController.php', '163', '159', '2', '2026-09-30 16:55:22','0','0'); -- id=1486
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '261200',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('259650','1550', '0', '2', 'اضافة فاتورة مبيعات', '18', '261200', '2026-09-30 16:55:22', '2',  'sellbillController.php','1','','0'); -- id=30
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1550', '1550', '2026-09-30', '2', '0', '0', '2026-09-30 16:55:22','اضافة فاتورة مبيعات رقم 18','1','0',null,'0','18','sellbillController.php?do=showDetail&sellbillid=18'); -- id=821
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('821', '419', '1550', '','0'); -- id=822
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '261200', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('821', '143', '1550', '','0'); -- id=821
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '281450', 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 ( '1450', '1450', '2026-09-30', '2', '0', '0', '2026-09-30 16:55:22','اضافة فاتورة مبيعات رقم 18 - صرف البضاعة من المخزن','1','0',null,'0','18','sellbillController.php?do=showDetail&sellbillid=18'); -- id=822
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('822', '402', '1450', '','0'); -- id=823
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '273969.35', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('822', '382', '1450', '','0'); -- id=822
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12783370.65', 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='821,0,822' where sellbillid=18;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 1550, 1450, 1450
                    , 1444.56, 1450, 1444.56, 1450
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1450, 1444.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1550, sellCostBuyPrice =sellCostBuyPrice+1450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1444.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1444.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1444.56
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1550, 1450, 1450
                    , 1444.56, 1450, 1444.56, 1450
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1450, 1444.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1550, sellCostBuyPrice =sellCostBuyPrice+1450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1444.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1444.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1444.56
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1550, 1450, 1450
                    , 1444.56, 1450, 1444.56, 1450, 1450, 1444.56)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1550, netSellCostBuyPrice = netSellCostBuyPrice+1450
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1450
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1444.56
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1450
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1444.56
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1450
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1450
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1444.56;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abd0e28c9ef8 and sellbillId = 18 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:25:22";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:55:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 16:55:22', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1239
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:25:51";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:55:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 16:55:51', '1', 'autosave', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=1240
UPDATE storedetail SET  productquantity = '72', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1357';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1357', '1', '72', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '144', '72', '1', '2026-09-30','0','0'); -- id=1487
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '29520', '29520', '2026-09-30', '1', '0', '0', '2026-09-30 16:55:51','اعادة جرد للمنتج : (تريكو سفنتي 430/سفنتي) فى مخزن : (المخزن الرئيسي) بالكمية : 72','1','0',null,'0','1487','inventoryController.php?do=details&id=1487'); -- id=823
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('823', '188', '29520', '','0'); -- id=824
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '92540', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('823', '382', '29520', '','0'); -- id=823
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12753850.65', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:27:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:57:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 16:57:03', '1', 'autosave', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=1241
UPDATE storedetail SET  productquantity = '48', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1358';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1358', '1', '48', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '96', '48', '1', '2026-09-30','0','0'); -- id=1488
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '18240', '18240', '2026-09-30', '1', '0', '0', '2026-09-30 16:57:03','اعادة جرد للمنتج : (تريكو سفنتي 400/سفنتي) فى مخزن : (المخزن الرئيسي) بالكمية : 48','1','0',null,'0','1488','inventoryController.php?do=details&id=1488'); -- id=824
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('824', '188', '18240', '','0'); -- id=825
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '110780', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('824', '382', '18240', '','0'); -- id=824
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12735610.65', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:27:25";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:57:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 16:57:25', '1', 'autosave', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=1242
UPDATE storedetail SET  productquantity = '64', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1359';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1359', '1', '64', '1', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالنقص', 'inventoryController.php', '128', '64', '1', '2026-09-30','0','0'); -- id=1489
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '23680', '23680', '2026-09-30', '1', '0', '0', '2026-09-30 16:57:25','اعادة جرد للمنتج : (تريكو سفنتي 390/سفنتي) فى مخزن : (المخزن الرئيسي) بالكمية : 64','1','0',null,'0','1489','inventoryController.php?do=details&id=1489'); -- id=825
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('825', '188', '23680', '','0'); -- id=826
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '134460', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('825', '382', '23680', '','0'); -- id=825
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12711930.65', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:27:52";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:57:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:57:52', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=1243
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:28:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:58:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:58:00', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1244
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:28:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:58:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:58:11', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1245
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:28:52";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:58:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 16:58:52', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1246
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:28:54";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:58:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:58:54', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=1247
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:29:01";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 16:59:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 16:59:01', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1248
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:30:30";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:00:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 17:00:30', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1249
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:34:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:04:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 17:04:04', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1250
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:34:04";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 17:04:04', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1251
UPDATE user SET loginip = "" WHERE userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:34:30";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:04:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:04:30', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1252
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:34:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:04:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:04:33', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1253
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:34:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:04:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:04:38', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1254
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:34:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:04:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:04:56', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1255
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:34:59";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:04:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:04:59', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1256
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:35:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:05:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:05:16', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1257
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:35:19";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:05:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:05:19', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1258
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:36:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:06:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:06:38', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1259
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:36:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:06:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:06:42', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1260
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:36:58";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:06:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-09-30 17:06:58', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=1261
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:37:01";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:07:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-09-30 17:07:01', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=1262
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:37:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:07:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-09-30 17:07:03', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=1263
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:37:44";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:07:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:07:44', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1264
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:37:59";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:07:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:07:59', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1265
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:38:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:08:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:08:02', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1266
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:38:05";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:08:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:08:05', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1267
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:38:15";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:08:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreportbills.php', '2026-09-30 17:08:15', '1', 'showbills', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreportbills.php?do=showbills'); -- id=1268
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:38:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:08:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:08:47', '1', 'editsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=16'); -- id=1269
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:38:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:08:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:08:56', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=update'); -- id=1270
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 16;
UPDATE sellbill SET  sellbillsysdate = '2026-09-30 17:08:56', userid = '2',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '16';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 7;
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 26;
 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 (833, '2026-09-30', 6750, 6450, 6450
                    , 6450, 6450, 6450, 6450
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 6450, 6450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6750, sellCostBuyPrice =sellCostBuyPrice-6450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6450
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6750, 6450, 6450
                    , 6450, 6450, 6450, 6450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6450, 6450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6750, sellCostBuyPrice =sellCostBuyPrice-6450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6450
                        , returnSellVal = returnSellVal-0, 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 = '64', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '833';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('833', '1', '15', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '49', '64', '1', '2026-09-30 15:48:30','0','0'); -- id=1490
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-25 where id = 6;
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 27;
 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 (1322, '2026-09-30', 9625, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0,25,0, 9000, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9625, sellCostBuyPrice =sellCostBuyPrice-9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4500
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-25
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9625, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9000, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9625, sellCostBuyPrice =sellCostBuyPrice-9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4500
                        , returnSellVal = returnSellVal-0, 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 = '45', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1322';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1322', '1', '25', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '20', '45', '1', '2026-09-30 15:48:30','0','0'); -- id=1491
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-20 where id = 5;
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        , lastbuyprice_withTax = 375, meanbuyprice_withTax = 187.5, lastbuyprice_withDiscountAndTax = 375
                where sellbilldetailid = 28;
 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 (1321, '2026-09-30', 8000, 7500, 7500
                    , 7500, 7500, 7500, 7500
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 7500, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8000, sellCostBuyPrice =sellCostBuyPrice-7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-20
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 8000, 7500, 7500
                    , 7500, 7500, 7500, 7500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7500, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8000, sellCostBuyPrice =sellCostBuyPrice-7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3750
                        , returnSellVal = returnSellVal-0, 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 = '40', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1321';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1321', '1', '20', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '20', '40', '1', '2026-09-30 15:48:30','0','0'); -- id=1492
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 28;
UPDATE sellbilldetail SET  lastbuyprice = 565.00 , meanbuyprice = 565.00, lastbuyprice_withDiscount = 557.37, meanbuyprice_withDiscount = 557.37
        , lastbuyprice_withTax = 565, meanbuyprice_withTax = 565, lastbuyprice_withDiscountAndTax = 557.37
                where sellbilldetailid = 29;
 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 (1334, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5850, sellCostBuyPrice =sellCostBuyPrice-5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-10
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5850, sellCostBuyPrice =sellCostBuyPrice-5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1334';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1334', '1', '10', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '10', '1', '2026-09-30 15:48:30','0','0'); -- id=1493
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 21;
UPDATE sellbilldetail SET  lastbuyprice = 625.00 , meanbuyprice = 625.00, lastbuyprice_withDiscount = 625.00, meanbuyprice_withDiscount = 625.00
        , lastbuyprice_withTax = 625, meanbuyprice_withTax = 625, lastbuyprice_withDiscountAndTax = 625
                where sellbilldetailid = 30;
 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 (1341, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3225, sellCostBuyPrice =sellCostBuyPrice-3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3125
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3225, sellCostBuyPrice =sellCostBuyPrice-3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3125
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1341';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1341', '1', '5', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '15', '1', '2026-09-30 15:48:30','0','0'); -- id=1494
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-20 where id = 19;
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 31;
 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 (1339, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8600
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-20
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8600
                        , returnSellVal = returnSellVal-0, 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 = '25', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1339';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1339', '1', '20', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '25', '1', '2026-09-30 15:48:30','0','0'); -- id=1495
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 24;
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 510
                where sellbilldetailid = 32;
 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 (945, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7950, sellCostBuyPrice =sellCostBuyPrice-7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7950, sellCostBuyPrice =sellCostBuyPrice-7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7650
                        , returnSellVal = returnSellVal-0, 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 = '35', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '945';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('945', '1', '15', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '20', '35', '1', '2026-09-30 15:48:30','0','0'); -- id=1496
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 20;
UPDATE sellbilldetail SET  lastbuyprice = 630.00 , meanbuyprice = 630.00, lastbuyprice_withDiscount = 630.00, meanbuyprice_withDiscount = 630.00
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 630, lastbuyprice_withDiscountAndTax = 630
                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 (1340, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3250, sellCostBuyPrice =sellCostBuyPrice-3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3150
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3250, sellCostBuyPrice =sellCostBuyPrice-3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3150
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1340';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1340', '1', '5', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '15', '1', '2026-09-30 15:48:30','0','0'); -- id=1497
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 18;
UPDATE sellbilldetail SET  lastbuyprice = 700.00 , meanbuyprice = 700.00, lastbuyprice_withDiscount = 700.00, meanbuyprice_withDiscount = 700.00
        , lastbuyprice_withTax = 700, meanbuyprice_withTax = 700, lastbuyprice_withDiscountAndTax = 700
                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 (1338, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3600, sellCostBuyPrice =sellCostBuyPrice-3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3500
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3600, sellCostBuyPrice =sellCostBuyPrice-3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3500
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1338';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1338', '1', '5', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '15', '1', '2026-09-30 15:48:30','0','0'); -- id=1498
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 36;
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 485.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 485.00
        , lastbuyprice_withTax = 485, meanbuyprice_withTax = 485, lastbuyprice_withDiscountAndTax = 485
                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 (1344, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7575, sellCostBuyPrice =sellCostBuyPrice-7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7275
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7575, sellCostBuyPrice =sellCostBuyPrice-7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7275
                        , returnSellVal = returnSellVal-0, 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 = '40', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1344', '1', '15', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '25', '40', '1', '2026-09-30 15:48:30','0','0'); -- id=1499
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 22;
UPDATE sellbilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 750.00, meanbuyprice_withDiscount = 750.00
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 750, lastbuyprice_withDiscountAndTax = 750
                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 (1342, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3850, sellCostBuyPrice =sellCostBuyPrice-3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3850, sellCostBuyPrice =sellCostBuyPrice-3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1342';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1342', '1', '5', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '10', '1', '2026-09-30 15:48:30','0','0'); -- id=1500
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 26;
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 641.23, meanbuyprice_withDiscount = 641.23
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 650, lastbuyprice_withDiscountAndTax = 641.23
                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 (1332, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3350, sellCostBuyPrice =sellCostBuyPrice-3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3250
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3350, sellCostBuyPrice =sellCostBuyPrice-3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3250
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1332';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1332', '1', '5', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '15', '1', '2026-09-30 15:48:30','0','0'); -- id=1501
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 45;
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                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 (1353, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6200, sellCostBuyPrice =sellCostBuyPrice-6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-10
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6200, sellCostBuyPrice =sellCostBuyPrice-6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6000
                        , returnSellVal = returnSellVal-0, 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 = '25', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1353';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1353', '1', '10', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '25', '1', '2026-09-30 15:48:30','0','0'); -- id=1502
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-18 where id = 37;
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                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 (1345, '2026-09-30', 10620, 10260, 10260
                    , 10260, 10260, 10260, 10260
                    , 0, 0, 0, 0
                    , 0, 0, 0,18,0, 10260, 10260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-10620, sellCostBuyPrice =sellCostBuyPrice-10260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-10260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-10260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-10260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-10260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-10260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-10260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-10260
                        , returnSellVal = returnSellVal-0, 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-18
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 10620, 10260, 10260
                    , 10260, 10260, 10260, 10260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10260, 10260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-10620, sellCostBuyPrice =sellCostBuyPrice-10260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-10260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-10260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-10260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-10260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-10260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-10260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-10260
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1345';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1345', '1', '18', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '30', '1', '2026-09-30 15:48:30','0','0'); -- id=1503
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 23;
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 40;
 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 (1343, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3450, sellCostBuyPrice =sellCostBuyPrice-3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3350
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3450, sellCostBuyPrice =sellCostBuyPrice-3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3350
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1343';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1343', '1', '5', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '20', '1', '2026-09-30 15:48:30','0','0'); -- id=1504
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 25;
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 591.90, meanbuyprice_withDiscount = 591.90
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 591.9
                where sellbilldetailid = 41;
 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 (1331, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3100, sellCostBuyPrice =sellCostBuyPrice-3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3100, sellCostBuyPrice =sellCostBuyPrice-3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1331';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1331', '1', '5', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '20', '1', '2026-09-30 15:48:30','0','0'); -- id=1505
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 35;
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 580.00, meanbuyprice_withDiscount = 580.00
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where sellbilldetailid = 42;
 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 (1330, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8700
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8700
                        , returnSellVal = returnSellVal-0, 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 = '80', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1330';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1330', '1', '15', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '65', '80', '1', '2026-09-30 15:48:30','0','0'); -- id=1506
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-30 where id = 44;
UPDATE sellbilldetail SET  lastbuyprice = 615.00 , meanbuyprice = 615.00, lastbuyprice_withDiscount = 615.00, meanbuyprice_withDiscount = 615.00
        , lastbuyprice_withTax = 615, meanbuyprice_withTax = 615, lastbuyprice_withDiscountAndTax = 615
                where sellbilldetailid = 43;
 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 (1352, '2026-09-30', 19050, 18450, 18450
                    , 18450, 18450, 18450, 18450
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 18450, 18450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-19050, sellCostBuyPrice =sellCostBuyPrice-18450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-18450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-18450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-18450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-18450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-18450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-18450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-18450
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-30
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 19050, 18450, 18450
                    , 18450, 18450, 18450, 18450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18450, 18450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-19050, sellCostBuyPrice =sellCostBuyPrice-18450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-18450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-18450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-18450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-18450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-18450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-18450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-18450
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1352', '1', '30', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '30', '1', '2026-09-30 15:48:30','0','0'); -- id=1507
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 34;
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 44;
 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 (1329, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5900, sellCostBuyPrice =sellCostBuyPrice-5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5700
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-10
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5900, sellCostBuyPrice =sellCostBuyPrice-5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5700
                        , returnSellVal = returnSellVal-0, 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 = '40', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1329';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1329', '1', '10', '0', '16', 'تعديل فاتورة مبيعات', 'sellbillController.php', '30', '40', '1', '2026-09-30 15:48:30','0','0'); -- id=1508
CALL clientInUse(5,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '5';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('5','0.00','0.00','1','تعديل فاتورة مبيعات','16', '0', '2026-09-30 15:48:30', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '129345', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 15:48:30','0','0','',''); -- id=32
UPDATE client SET  inUse = 0 where clientid = 5;
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '131855',  userid = '1' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('261200','129345', '1', '2', 'تعديل فاتورة مبيعات', '16', '131855', '2026-09-30 17:08:56', '1',  'sellbillController.php','5','','0'); -- id=31
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 129345, 124360, 124360
                    , 124360, 124199.35, 124199.35, 124199.35
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,124360, 116110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-129345, sellCostBuyPrice =sellCostBuyPrice-124360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-124360, sellCostMeanBuyPrice = sellCostMeanBuyPrice-124360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-124199.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-124199.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-124199.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-124360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-116110
                        , returnSellVal = returnSellVal-0, 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 (5, '2026-09-30', 129345, 124360, 124360
                    , 124360, 124199.35, 124199.35, 124199.35
                    , 0, 0, 0, 0
                    , 0, 0, 0, 124360, 116110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-129345, sellCostBuyPrice =sellCostBuyPrice-124360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-124360, sellCostMeanBuyPrice = sellCostMeanBuyPrice-124360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-124199.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-124199.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-124199.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-124360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-116110
                        , returnSellVal = returnSellVal-0, 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, 129345, 124360, 124360
                    , 124360, 124199.35, 124199.35, 124199.35, 124360, 116110)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-129345, netSellCostBuyPrice = netSellCostBuyPrice-124360
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-124360
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-124360
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-124199.35
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-124199.35
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-124199.35
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-124360
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-116110;

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


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

COMMIT;
BEGIN;
CALL clientInUse(5,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,shipfrom,shipto,paymethodshipping,whatShippingCost,sellbilltypeclientid,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 15:48:30', '06abcfa7c85075', '5', '0.00', '0', '0', '1', '129345', '129345', '129345', '0', '1', '2026-09-30 15:48:30', '', '1', '0', 'محل VIP', '2', '1', '3', '0', 'محل VIP', '238', '16', 'sellbillController', '0','','','','','-1','0','0','129345','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-30','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0',''); -- id=19
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '5';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('5','0.00','0','0','اضافة فاتورة مبيعات (معدله)','19', '0', '2026-09-30 17:08:56', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '129345', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 15:48:30','0','0','',''); -- id=33
UPDATE client SET  inUse = 0 where clientid = 5;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 7;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('430','07429', '19', '19', '833', '15.00', '450', '6750', '0', '', '0', '2026-09-30 17:08:56', '833', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','7-15,','1','1','0','0','450','6750','0','','0','0.00','0','0','0','0'); -- id=64
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 64;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (833, '2026-09-30', 6750, 6450, 6450
                    , 6450, 6450, 6450, 6450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 6450, 6450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6750, sellCostBuyPrice =sellCostBuyPrice+6450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6750, 6450, 6450
                    , 6450, 6450, 6450, 6450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6450, 6450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6750, sellCostBuyPrice =sellCostBuyPrice+6450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6450
                        , returnSellVal = returnSellVal+0, 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 = '49', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '833';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('833', '1', '15', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '64', '49', '1', '2026-09-30 17:08:56','0','0'); -- id=1509
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+25 where id = 6;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','01322', '19', '39', '1322', '25.00', '385', '9625', '0', '', '0', '2026-09-30 17:08:56', '1322', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6-25,','1','1','0','0','385','9625','0','','0','0.00','0','0','0','0'); -- id=65
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 65;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1322, '2026-09-30', 9625, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 25, 0, 9000, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9625, sellCostBuyPrice =sellCostBuyPrice+9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+25
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9625, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9000, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9625, sellCostBuyPrice =sellCostBuyPrice+9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1322';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1322', '1', '25', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '45', '20', '1', '2026-09-30 17:08:56','0','0'); -- id=1510
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 5;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','01321', '19', '39', '1321', '20.00', '400', '8000', '0', '', '0', '2026-09-30 17:08:56', '1321', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','5-20,','1','1','0','0','400','8000','0','','0','0.00','0','0','0','0'); -- id=66
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        , lastbuyprice_withTax = 375, meanbuyprice_withTax = 187.5, lastbuyprice_withDiscountAndTax = 375
                where sellbilldetailid = 66;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1321, '2026-09-30', 8000, 7500, 7500
                    , 7500, 7500, 7500, 7500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 7500, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8000, sellCostBuyPrice =sellCostBuyPrice+7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 8000, 7500, 7500
                    , 7500, 7500, 7500, 7500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7500, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8000, sellCostBuyPrice =sellCostBuyPrice+7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1321';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1321', '1', '20', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '40', '20', '1', '2026-09-30 17:08:56','0','0'); -- id=1511
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 28;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('557.37','01334', '19', '8', '1334', '10.00', '585', '5850', '0', '', '0', '2026-09-30 17:08:56', '1334', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','28-10,','1','1','0','0','585','5850','0','','0','0.00','0','0','0','0'); -- id=67
UPDATE sellbilldetail SET  lastbuyprice = 565.00 , meanbuyprice = 565.00, lastbuyprice_withDiscount = 557.37, meanbuyprice_withDiscount = 557.37
        , lastbuyprice_withTax = 565, meanbuyprice_withTax = 565, lastbuyprice_withDiscountAndTax = 557.37
                where sellbilldetailid = 67;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1334, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5850, sellCostBuyPrice =sellCostBuyPrice+5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5850, sellCostBuyPrice =sellCostBuyPrice+5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1334';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1334', '1', '10', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '0', '1', '2026-09-30 17:08:56','0','0'); -- id=1512
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 21;
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 ('625','01341', '19', '28', '1341', '5.00', '645', '3225', '0', '', '0', '2026-09-30 17:08:56', '1341', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','21-5,','1','1','0','0','645','3225','0','','0','0.00','0','0','0','0'); -- id=68
UPDATE sellbilldetail SET  lastbuyprice = 625.00 , meanbuyprice = 625.00, lastbuyprice_withDiscount = 625.00, meanbuyprice_withDiscount = 625.00
        , lastbuyprice_withTax = 625, meanbuyprice_withTax = 625, lastbuyprice_withDiscountAndTax = 625
                where sellbilldetailid = 68;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1341, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1341';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1341', '1', '5', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '10', '1', '2026-09-30 17:08:56','0','0'); -- id=1513
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 19;
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 ('430','01339', '19', '28', '1339', '20.00', '450', '9000', '0', '', '0', '2026-09-30 17:08:56', '1339', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','19-20,','1','1','0','0','450','9000','0','','0','0.00','0','0','0','0'); -- id=69
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 69;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1339, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1339';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1339', '1', '20', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '25', '5', '1', '2026-09-30 17:08:56','0','0'); -- id=1514
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 24;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('510','09724', '19', '28', '945', '15.00', '530', '7950', '0', '', '0', '2026-09-30 17:08:56', '945', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','24-15,','1','1','0','0','530','7950','0','','0','0.00','0','0','0','0'); -- id=70
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 510
                where sellbilldetailid = 70;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (945, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7950, sellCostBuyPrice =sellCostBuyPrice+7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7950, sellCostBuyPrice =sellCostBuyPrice+7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '945';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('945', '1', '15', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '35', '20', '1', '2026-09-30 17:08:56','0','0'); -- id=1515
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 20;
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 ('630','01340', '19', '28', '1340', '5.00', '650', '3250', '0', '', '0', '2026-09-30 17:08:56', '1340', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','20-5,','1','1','0','0','650','3250','0','','0','0.00','0','0','0','0'); -- id=71
UPDATE sellbilldetail SET  lastbuyprice = 630.00 , meanbuyprice = 630.00, lastbuyprice_withDiscount = 630.00, meanbuyprice_withDiscount = 630.00
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 630, lastbuyprice_withDiscountAndTax = 630
                where sellbilldetailid = 71;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1340, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1340';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1340', '1', '5', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '10', '1', '2026-09-30 17:08:56','0','0'); -- id=1516
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 18;
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 ('700','01338', '19', '28', '1338', '5.00', '720', '3600', '0', '', '0', '2026-09-30 17:08:56', '1338', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','18-5,','1','1','0','0','720','3600','0','','0','0.00','0','0','0','0'); -- id=72
UPDATE sellbilldetail SET  lastbuyprice = 700.00 , meanbuyprice = 700.00, lastbuyprice_withDiscount = 700.00, meanbuyprice_withDiscount = 700.00
        , lastbuyprice_withTax = 700, meanbuyprice_withTax = 700, lastbuyprice_withDiscountAndTax = 700
                where sellbilldetailid = 72;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1338, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1338';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1338', '1', '5', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '10', '1', '2026-09-30 17:08:56','0','0'); -- id=1517
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 36;
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 ('485','01344', '19', '31', '1344', '15.00', '505', '7575', '0', '', '0', '2026-09-30 17:08:56', '1344', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','36-15,','1','1','0','0','505','7575','0','','0','0.00','0','0','0','0'); -- id=73
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 485.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 485.00
        , lastbuyprice_withTax = 485, meanbuyprice_withTax = 485, lastbuyprice_withDiscountAndTax = 485
                where sellbilldetailid = 73;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1344, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7575, sellCostBuyPrice =sellCostBuyPrice+7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7275
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7575, sellCostBuyPrice =sellCostBuyPrice+7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7275
                        , returnSellVal = returnSellVal+0, 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 = '25', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1344', '1', '15', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '40', '25', '1', '2026-09-30 17:08:56','0','0'); -- id=1518
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 22;
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 ('750','01342', '19', '28', '1342', '5.00', '770', '3850', '0', '', '0', '2026-09-30 17:08:56', '1342', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','22-5,','1','1','0','0','770','3850','0','','0','0.00','0','0','0','0'); -- id=74
UPDATE sellbilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 750.00, meanbuyprice_withDiscount = 750.00
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 750, lastbuyprice_withDiscountAndTax = 750
                where sellbilldetailid = 74;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1342, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1342';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1342', '1', '5', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '5', '1', '2026-09-30 17:08:56','0','0'); -- id=1519
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 26;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('641.23','01332', '19', '8', '1332', '5.00', '670', '3350', '0', '', '0', '2026-09-30 17:08:56', '1332', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','26-5,','1','1','0','0','670','3350','0','','0','0.00','0','0','0','0'); -- id=75
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 641.23, meanbuyprice_withDiscount = 641.23
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 650, lastbuyprice_withDiscountAndTax = 641.23
                where sellbilldetailid = 75;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1332, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3350, sellCostBuyPrice =sellCostBuyPrice+3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3350, sellCostBuyPrice =sellCostBuyPrice+3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1332';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1332', '1', '5', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '10', '1', '2026-09-30 17:08:56','0','0'); -- id=1520
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 45;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('600','01353', '19', '31', '1353', '10.00', '620', '6200', '0', '', '0', '2026-09-30 17:08:56', '1353', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','45-10,','1','1','0','0','620','6200','0','','0','0.00','0','0','0','0'); -- id=76
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where sellbilldetailid = 76;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1353, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6200, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6200, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1353';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1353', '1', '10', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '25', '15', '1', '2026-09-30 17:08:56','0','0'); -- id=1521
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+18 where id = 37;
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 ('570','01345', '19', '31', '1345', '18.00', '590', '10620', '0', '', '0', '2026-09-30 17:08:56', '1345', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','37-18,','1','1','0','0','590','10620','0','','0','0.00','0','0','0','0'); -- id=77
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 77;
 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 (1345, '2026-09-30', 10620, 10260, 10260
                    , 10260, 10260, 10260, 10260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 10260, 10260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10620, sellCostBuyPrice =sellCostBuyPrice+10260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10260
                        , returnSellVal = returnSellVal+0, 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+18
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 10620, 10260, 10260
                    , 10260, 10260, 10260, 10260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10260, 10260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10620, sellCostBuyPrice =sellCostBuyPrice+10260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10260
                        , returnSellVal = returnSellVal+0, 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 = '2026-09-30 17:08:56' WHERE storedetailid = '1345';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1345', '1', '18', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '30', '12', '1', '2026-09-30 17:08:56','0','0'); -- id=1522
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 23;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','01343', '19', '28', '1343', '5.00', '690', '3450', '0', '', '0', '2026-09-30 17:08:56', '1343', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','23-5,','1','1','0','0','690','3450','0','','0','0.00','0','0','0','0'); -- id=78
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 78;
 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 (1343, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3450, sellCostBuyPrice =sellCostBuyPrice+3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3450, sellCostBuyPrice =sellCostBuyPrice+3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1343';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1343', '1', '5', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '15', '1', '2026-09-30 17:08:56','0','0'); -- id=1523
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 25;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('591.9','01331', '19', '8', '1331', '5.00', '620', '3100', '0', '', '0', '2026-09-30 17:08:56', '1331', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','25-5,','1','1','0','0','620','3100','0','','0','0.00','0','0','0','0'); -- id=79
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 591.90, meanbuyprice_withDiscount = 591.90
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 591.9
                where sellbilldetailid = 79;
 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 (1331, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1331';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1331', '1', '5', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '15', '1', '2026-09-30 17:08:56','0','0'); -- id=1524
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 35;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('580','01330', '19', '37', '1330', '15.00', '600', '9000', '0', '', '0', '2026-09-30 17:08:56', '1330', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','35-15,','1','1','0','0','600','9000','0','','0','0.00','0','0','0','0'); -- id=80
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 580.00, meanbuyprice_withDiscount = 580.00
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where sellbilldetailid = 80;
 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 (1330, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '65', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1330';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1330', '1', '15', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '80', '65', '1', '2026-09-30 17:08:56','0','0'); -- id=1525
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+30 where id = 44;
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 ('615','01352', '19', '31', '1352', '30.00', '635', '19050', '0', '', '0', '2026-09-30 17:08:56', '1352', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','44-30,','1','1','0','0','635','19050','0','','0','0.00','0','0','0','0'); -- id=81
UPDATE sellbilldetail SET  lastbuyprice = 615.00 , meanbuyprice = 615.00, lastbuyprice_withDiscount = 615.00, meanbuyprice_withDiscount = 615.00
        , lastbuyprice_withTax = 615, meanbuyprice_withTax = 615, lastbuyprice_withDiscountAndTax = 615
                where sellbilldetailid = 81;
 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 (1352, '2026-09-30', 19050, 18450, 18450
                    , 18450, 18450, 18450, 18450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 18450, 18450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19050, sellCostBuyPrice =sellCostBuyPrice+18450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+30
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 19050, 18450, 18450
                    , 18450, 18450, 18450, 18450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18450, 18450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19050, sellCostBuyPrice =sellCostBuyPrice+18450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1352', '1', '30', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '30', '0', '1', '2026-09-30 17:08:56','0','0'); -- id=1526
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 34;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('570','01329', '19', '37', '1329', '10.00', '590', '5900', '0', '', '0', '2026-09-30 17:08:56', '1329', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','34-10,','1','1','0','0','590','5900','0','','0','0.00','0','0','0','0'); -- id=82
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 82;
 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 (1329, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5900, sellCostBuyPrice =sellCostBuyPrice+5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5900, sellCostBuyPrice =sellCostBuyPrice+5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-09-30 17:08:56' WHERE storedetailid = '1329';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1329', '1', '10', '1', '19', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '40', '30', '1', '2026-09-30 17:08:56','0','0'); -- id=1527
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '261200',  userid = '1' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('131855','129345', '0', '2', 'اضافة فاتورة مبيعات (معدله)', '19', '261200', '2026-09-30 17:08:56', '1',  'sellbillController.php','5','','0'); -- id=32
UPDATE dailyentry SET totalcreditor = '129345.00', totaldebtor = '129345.00', thedate = '2026-09-30', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 15:48:30', entryComment = 'اضافة فاتورة مبيعات رقم 16', fromFlag = '1',related='0',isopeningentry='0',operationId='16',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=16' WHERE id = '807';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '129345.00', '129345.00', '2026-09-30', '1', '0', '807', '2026-09-30 17:08:56','تم عكس القيد رقم 807 ','1','0','0','0','0',''); -- id=826
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('826', '497', '129345.00', '','0'); -- id=826
UPDATE accountstree SET name = 'محل VIP', customName = 'محل VIP', customNameEn = 'محل VIP', nameEn = 'محل VIP', parent = '58', accountNature = '0', theValue = '-129345', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:40:12' WHERE id = '497';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('826', '143', '129345.00', '','0'); -- id=827
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '152105', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
UPDATE dailyentry SET totalcreditor = '129345.00', totaldebtor = '129345.00', thedate = '2026-09-30', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 15:48:30', entryComment = 'اضافة فاتورة مبيعات رقم 16 - تحصيل الفاتورة من العميل', fromFlag = '1',related='0',isopeningentry='0',operationId='16',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=16' WHERE id = '808';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '129345.00', '129345.00', '2026-09-30', '1', '0', '808', '2026-09-30 17:08:56','تم عكس القيد رقم 808 ','1','0','0','0','0',''); -- id=827
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('827', '419', '129345.00', '','0'); -- id=827
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '131855', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('827', '497', '129345.00', '','0'); -- id=828
UPDATE accountstree SET name = 'محل VIP', customName = 'محل VIP', customNameEn = 'محل VIP', nameEn = 'محل VIP', parent = '58', accountNature = '0', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:40:12' WHERE id = '497';
UPDATE dailyentry SET totalcreditor = '124199.35', totaldebtor = '124199.35', thedate = '2026-09-30', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 15:48:30', entryComment = 'اضافة فاتورة مبيعات رقم 16 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='16',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=16' WHERE id = '809';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '124199.35', '124199.35', '2026-09-30', '1', '0', '809', '2026-09-30 17:08:56','تم عكس القيد رقم 809 ','1','0','0','0','0',''); -- id=828
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('828', '402', '124199.35', '','0'); -- id=828
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '149770', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('828', '382', '124199.35', '','0'); -- id=829
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12836130', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '129345', '129345', '2026-09-30', '1', '0', '0', '2026-09-30 17:08:56','اضافة فاتورة مبيعات رقم 19','1','0',null,'0','19','sellbillController.php?do=showDetail&sellbillid=19'); -- id=829
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('829', '497', '129345', '','0'); -- id=830
UPDATE accountstree SET name = 'محل VIP', customName = 'محل VIP', customNameEn = 'محل VIP', nameEn = 'محل VIP', parent = '58', accountNature = '0', theValue = '129345', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:40:12' WHERE id = '497';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('829', '143', '129345', '','0'); -- id=829
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '281450', 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 ( '129345', '129345', '2026-09-30', '1', '0', '0', '2026-09-30 17:08:56','اضافة فاتورة مبيعات رقم 19 - تحصيل الفاتورة من العميل','1','0',null,'0','19','sellbillController.php?do=showDetail&sellbillid=19'); -- id=830
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('830', '419', '129345', '','0'); -- id=831
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '261200', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('830', '497', '129345', '','0'); -- id=830
UPDATE accountstree SET name = 'محل VIP', customName = 'محل VIP', customNameEn = 'محل VIP', nameEn = 'محل VIP', parent = '58', accountNature = '0', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:40:12' WHERE id = '497';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '124199.35', '124199.35', '2026-09-30', '1', '0', '0', '2026-09-30 17:08:56','اضافة فاتورة مبيعات رقم 19 - صرف البضاعة من المخزن','1','0',null,'0','19','sellbillController.php?do=showDetail&sellbillid=19'); -- id=831
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('831', '402', '124199.35', '','0'); -- id=832
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '273969.35', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('831', '382', '124199.35', '','0'); -- id=831
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12711930.65', 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='829,830,831' where sellbillid=19;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 129345, 124360, 124360
                    , 124360, 124199.35, 124199.35, 124199.35
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,124360, 116110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+129345, sellCostBuyPrice =sellCostBuyPrice+124360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+124360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+124360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+124199.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+124199.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+124199.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+124360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+116110
                        , returnSellVal = returnSellVal+0, 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 (5, '2026-09-30', 129345, 124360, 124360
                    , 124360, 124199.35, 124199.35, 124199.35
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,124360, 116110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+129345, sellCostBuyPrice =sellCostBuyPrice+124360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+124360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+124360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+124199.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+124199.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+124199.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+124360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+116110
                        , returnSellVal = returnSellVal+0, 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, 129345, 124360, 124360
                    , 124360, 124199.35, 124199.35, 124199.35, 124360, 116110)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+129345, netSellCostBuyPrice = netSellCostBuyPrice+124360
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+124360
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+124360
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+124199.35
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+124199.35
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+124199.35
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+124360
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+116110;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 16 and newid=19 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:38:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:08:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:08:56', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editprint&id=19'); -- id=1271
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:39:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:09:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreportbills.php', '2026-09-30 17:09:09', '1', 'showbills', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreportbills.php?do=showbills'); -- id=1272
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:39:15";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:09:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:09:15', '1', 'editsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=19'); -- id=1273
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:40:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:10:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 17:10:45', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1274
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:40:45";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 17:10:45', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1275
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:41:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:11:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 17:11:09', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=1276
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:41:22";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:11:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-09-30 17:11:22', '1', 'details', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=8'); -- id=1277
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:42:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:12:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productmovmentController.php', '2026-09-30 17:12:43', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productmovmentController.php'); -- id=1278
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:43:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:13:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productmovmentController.php', '2026-09-30 17:13:03', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productmovmentController.php?do=show'); -- id=1279
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:45:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:15:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productmovmentController.php', '2026-09-30 17:15:08', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productmovmentController.php?do=show'); -- id=1280
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:45:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:15:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productmovmentController.php', '2026-09-30 17:15:16', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productmovmentController.php?do=show'); -- id=1281
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:45:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:15:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productmovmentController.php', '2026-09-30 17:15:21', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productmovmentController.php?do=show'); -- id=1282
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:46:53";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:16:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 17:16:53', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=1283
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:47:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:17:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 17:17:38', '1', 'autosave', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=1284
UPDATE storedetail SET  productquantity = '25', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1321';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1321', '1', '5', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '20', '25', '1', '2026-09-30','0','0'); -- id=1528
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1875', '1875', '2026-09-30', '1', '0', '0', '2026-09-30 17:17:38','اعادة جرد للمنتج : (سلوتش قصات م 304/يورو ستار جينز) فى مخزن : (المخزن الرئيسي) بالكمية : 25','1','0',null,'0','1528','inventoryController.php?do=details&id=1528'); -- id=832
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('832', '382', '1875', '','0'); -- id=833
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12713805.65', 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 ('832', '188', '1875', '','0'); -- id=832
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '132585', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:48:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:18:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 17:18:57', '1', 'autosave', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=1285
UPDATE storedetail SET  productquantity = '25', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1321';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1321', '1', '25', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية لم يتغير', 'inventoryController.php', '25', '25', '1', '2026-09-30','0','0'); -- id=1529
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:49:30";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:19:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 17:19:30', '1', 'autosave', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=1286
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1345';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1345', '1', '18', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '12', '30', '1', '2026-09-30','0','0'); -- id=1530
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10260', '10260', '2026-09-30', '1', '0', '0', '2026-09-30 17:19:30','اعادة جرد للمنتج : (لامبورجيني 6144 فيلو/فيلو) فى مخزن : (المخزن الرئيسي) بالكمية : 30','1','0',null,'0','1530','inventoryController.php?do=details&id=1530'); -- id=833
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('833', '382', '10260', '','0'); -- id=834
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12724065.65', 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 ('833', '188', '10260', '','0'); -- id=833
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '122325', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:49:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:19:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:19:46', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=update'); -- id=1287
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 19;
UPDATE sellbill SET  sellbillsysdate = '2026-09-30 17:19:46', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '19';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 7;
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 64;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (833, '2026-09-30', 6750, 6450, 6450
                    , 6450, 6450, 6450, 6450
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 6450, 6450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6750, sellCostBuyPrice =sellCostBuyPrice-6450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6450
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6750, 6450, 6450
                    , 6450, 6450, 6450, 6450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6450, 6450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6750, sellCostBuyPrice =sellCostBuyPrice-6450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6450
                        , returnSellVal = returnSellVal-0, 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 = '64', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '833';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('833', '1', '15', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '49', '64', '1', '2026-09-30 15:48:30','0','0'); -- id=1531
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-25 where id = 6;
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 65;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1322, '2026-09-30', 9625, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0,25,0, 9000, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9625, sellCostBuyPrice =sellCostBuyPrice-9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4500
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-25
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9625, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9000, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9625, sellCostBuyPrice =sellCostBuyPrice-9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4500
                        , returnSellVal = returnSellVal-0, 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 = '45', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1322';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1322', '1', '25', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '20', '45', '1', '2026-09-30 15:48:30','0','0'); -- id=1532
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-20 where id = 5;
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        , lastbuyprice_withTax = 375, meanbuyprice_withTax = 187.5, lastbuyprice_withDiscountAndTax = 375
                where sellbilldetailid = 66;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1321, '2026-09-30', 8000, 7500, 7500
                    , 7500, 7500, 7500, 7500
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 7500, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8000, sellCostBuyPrice =sellCostBuyPrice-7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-20
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 8000, 7500, 7500
                    , 7500, 7500, 7500, 7500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7500, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8000, sellCostBuyPrice =sellCostBuyPrice-7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3750
                        , returnSellVal = returnSellVal-0, 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 = '45', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1321';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1321', '1', '20', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '25', '45', '1', '2026-09-30 15:48:30','0','0'); -- id=1533
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 28;
UPDATE sellbilldetail SET  lastbuyprice = 565.00 , meanbuyprice = 565.00, lastbuyprice_withDiscount = 557.37, meanbuyprice_withDiscount = 557.37
        , lastbuyprice_withTax = 565, meanbuyprice_withTax = 565, lastbuyprice_withDiscountAndTax = 557.37
                where sellbilldetailid = 67;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1334, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5850, sellCostBuyPrice =sellCostBuyPrice-5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-10
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5850, sellCostBuyPrice =sellCostBuyPrice-5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1334';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1334', '1', '10', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '10', '1', '2026-09-30 15:48:30','0','0'); -- id=1534
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 21;
UPDATE sellbilldetail SET  lastbuyprice = 625.00 , meanbuyprice = 625.00, lastbuyprice_withDiscount = 625.00, meanbuyprice_withDiscount = 625.00
        , lastbuyprice_withTax = 625, meanbuyprice_withTax = 625, lastbuyprice_withDiscountAndTax = 625
                where sellbilldetailid = 68;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1341, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3225, sellCostBuyPrice =sellCostBuyPrice-3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3125
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3225, sellCostBuyPrice =sellCostBuyPrice-3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3125
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1341';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1341', '1', '5', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '15', '1', '2026-09-30 15:48:30','0','0'); -- id=1535
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-20 where id = 19;
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 69;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1339, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8600
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-20
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8600
                        , returnSellVal = returnSellVal-0, 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 = '25', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1339';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1339', '1', '20', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '25', '1', '2026-09-30 15:48:30','0','0'); -- id=1536
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 24;
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 510
                where sellbilldetailid = 70;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (945, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7950, sellCostBuyPrice =sellCostBuyPrice-7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7950, sellCostBuyPrice =sellCostBuyPrice-7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7650
                        , returnSellVal = returnSellVal-0, 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 = '35', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '945';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('945', '1', '15', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '20', '35', '1', '2026-09-30 15:48:30','0','0'); -- id=1537
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 20;
UPDATE sellbilldetail SET  lastbuyprice = 630.00 , meanbuyprice = 630.00, lastbuyprice_withDiscount = 630.00, meanbuyprice_withDiscount = 630.00
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 630, lastbuyprice_withDiscountAndTax = 630
                where sellbilldetailid = 71;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1340, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3250, sellCostBuyPrice =sellCostBuyPrice-3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3150
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3250, sellCostBuyPrice =sellCostBuyPrice-3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3150
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1340';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1340', '1', '5', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '15', '1', '2026-09-30 15:48:30','0','0'); -- id=1538
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 18;
UPDATE sellbilldetail SET  lastbuyprice = 700.00 , meanbuyprice = 700.00, lastbuyprice_withDiscount = 700.00, meanbuyprice_withDiscount = 700.00
        , lastbuyprice_withTax = 700, meanbuyprice_withTax = 700, lastbuyprice_withDiscountAndTax = 700
                where sellbilldetailid = 72;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1338, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3600, sellCostBuyPrice =sellCostBuyPrice-3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3500
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3600, sellCostBuyPrice =sellCostBuyPrice-3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3500
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1338';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1338', '1', '5', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '15', '1', '2026-09-30 15:48:30','0','0'); -- id=1539
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 36;
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 485.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 485.00
        , lastbuyprice_withTax = 485, meanbuyprice_withTax = 485, lastbuyprice_withDiscountAndTax = 485
                where sellbilldetailid = 73;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1344, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7575, sellCostBuyPrice =sellCostBuyPrice-7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7275
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7575, sellCostBuyPrice =sellCostBuyPrice-7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7275
                        , returnSellVal = returnSellVal-0, 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 = '40', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1344', '1', '15', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '25', '40', '1', '2026-09-30 15:48:30','0','0'); -- id=1540
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 22;
UPDATE sellbilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 750.00, meanbuyprice_withDiscount = 750.00
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 750, lastbuyprice_withDiscountAndTax = 750
                where sellbilldetailid = 74;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1342, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3850, sellCostBuyPrice =sellCostBuyPrice-3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3850, sellCostBuyPrice =sellCostBuyPrice-3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1342';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1342', '1', '5', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '10', '1', '2026-09-30 15:48:30','0','0'); -- id=1541
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 26;
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 641.23, meanbuyprice_withDiscount = 641.23
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 650, lastbuyprice_withDiscountAndTax = 641.23
                where sellbilldetailid = 75;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1332, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3350, sellCostBuyPrice =sellCostBuyPrice-3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3250
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3350, sellCostBuyPrice =sellCostBuyPrice-3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3250
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1332';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1332', '1', '5', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '15', '1', '2026-09-30 15:48:30','0','0'); -- id=1542
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 45;
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where sellbilldetailid = 76;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1353, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6200, sellCostBuyPrice =sellCostBuyPrice-6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-10
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6200, sellCostBuyPrice =sellCostBuyPrice-6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6000
                        , returnSellVal = returnSellVal-0, 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 = '25', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1353';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1353', '1', '10', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '25', '1', '2026-09-30 15:48:30','0','0'); -- id=1543
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-18 where id = 37;
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 77;
 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 (1345, '2026-09-30', 10620, 10260, 10260
                    , 10260, 10260, 10260, 10260
                    , 0, 0, 0, 0
                    , 0, 0, 0,18,0, 10260, 10260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-10620, sellCostBuyPrice =sellCostBuyPrice-10260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-10260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-10260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-10260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-10260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-10260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-10260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-10260
                        , returnSellVal = returnSellVal-0, 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-18
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 10620, 10260, 10260
                    , 10260, 10260, 10260, 10260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10260, 10260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-10620, sellCostBuyPrice =sellCostBuyPrice-10260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-10260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-10260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-10260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-10260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-10260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-10260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-10260
                        , returnSellVal = returnSellVal-0, 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 = '48', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1345';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1345', '1', '18', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '30', '48', '1', '2026-09-30 15:48:30','0','0'); -- id=1544
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 23;
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 78;
 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 (1343, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3450, sellCostBuyPrice =sellCostBuyPrice-3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3350
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3450, sellCostBuyPrice =sellCostBuyPrice-3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3350
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1343';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1343', '1', '5', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '20', '1', '2026-09-30 15:48:30','0','0'); -- id=1545
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 25;
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 591.90, meanbuyprice_withDiscount = 591.90
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 591.9
                where sellbilldetailid = 79;
 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 (1331, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3100, sellCostBuyPrice =sellCostBuyPrice-3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3100, sellCostBuyPrice =sellCostBuyPrice-3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1331';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1331', '1', '5', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '20', '1', '2026-09-30 15:48:30','0','0'); -- id=1546
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 35;
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 580.00, meanbuyprice_withDiscount = 580.00
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where sellbilldetailid = 80;
 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 (1330, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8700
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8700
                        , returnSellVal = returnSellVal-0, 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 = '80', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1330';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1330', '1', '15', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '65', '80', '1', '2026-09-30 15:48:30','0','0'); -- id=1547
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-30 where id = 44;
UPDATE sellbilldetail SET  lastbuyprice = 615.00 , meanbuyprice = 615.00, lastbuyprice_withDiscount = 615.00, meanbuyprice_withDiscount = 615.00
        , lastbuyprice_withTax = 615, meanbuyprice_withTax = 615, lastbuyprice_withDiscountAndTax = 615
                where sellbilldetailid = 81;
 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 (1352, '2026-09-30', 19050, 18450, 18450
                    , 18450, 18450, 18450, 18450
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 18450, 18450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-19050, sellCostBuyPrice =sellCostBuyPrice-18450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-18450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-18450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-18450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-18450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-18450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-18450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-18450
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-30
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 19050, 18450, 18450
                    , 18450, 18450, 18450, 18450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18450, 18450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-19050, sellCostBuyPrice =sellCostBuyPrice-18450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-18450, sellCostMeanBuyPrice = sellCostMeanBuyPrice-18450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-18450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-18450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-18450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-18450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-18450
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1352', '1', '30', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '30', '1', '2026-09-30 15:48:30','0','0'); -- id=1548
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 34;
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 82;
 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 (1329, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5900, sellCostBuyPrice =sellCostBuyPrice-5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5700
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-10
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5900, sellCostBuyPrice =sellCostBuyPrice-5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5700
                        , returnSellVal = returnSellVal-0, 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 = '40', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1329';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1329', '1', '10', '0', '19', 'تعديل فاتورة مبيعات', 'sellbillController.php', '30', '40', '1', '2026-09-30 15:48:30','0','0'); -- id=1549
CALL clientInUse(5,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '5';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('5','0.00','0.00','1','تعديل فاتورة مبيعات','19', '0', '2026-09-30 15:48:30', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '129345', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 15:48:30','0','0','',''); -- id=34
UPDATE client SET  inUse = 0 where clientid = 5;
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '131855',  userid = '1' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('261200','129345', '1', '2', 'تعديل فاتورة مبيعات', '19', '131855', '2026-09-30 17:19:46', '1',  'sellbillController.php','5','','0'); -- id=33
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 129345, 124360, 124360
                    , 124360, 124199.35, 124199.35, 124199.35
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,124360, 116110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-129345, sellCostBuyPrice =sellCostBuyPrice-124360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-124360, sellCostMeanBuyPrice = sellCostMeanBuyPrice-124360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-124199.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-124199.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-124199.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-124360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-116110
                        , returnSellVal = returnSellVal-0, 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 (5, '2026-09-30', 129345, 124360, 124360
                    , 124360, 124199.35, 124199.35, 124199.35
                    , 0, 0, 0, 0
                    , 0, 0, 0, 124360, 116110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-129345, sellCostBuyPrice =sellCostBuyPrice-124360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-124360, sellCostMeanBuyPrice = sellCostMeanBuyPrice-124360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-124199.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-124199.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-124199.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-124360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-116110
                        , returnSellVal = returnSellVal-0, 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, 129345, 124360, 124360
                    , 124360, 124199.35, 124199.35, 124199.35, 124360, 116110)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-129345, netSellCostBuyPrice = netSellCostBuyPrice-124360
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-124360
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-124360
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-124199.35
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-124199.35
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-124199.35
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-124360
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-116110;

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


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

COMMIT;
BEGIN;
CALL clientInUse(5,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,shipfrom,shipto,paymethodshipping,whatShippingCost,sellbilltypeclientid,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 15:48:30', '06abcfa7c85075', '5', '0.00', '127280', '0', '1', '127280', '127280', '0', '127280', '1', '2026-09-30 15:48:30', '', '1', '0', 'محل VIP', '2', '1', '3', '0', 'محل VIP', '233', '19', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-30','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0',''); -- id=20
UPDATE client SET  clientdebt = '127280', userid = '1' WHERE clientid = '5';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('5','0.00','127280','0','اضافة فاتورة مبيعات (معدله)','20', '127280', '2026-09-30 17:19:46', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '127280', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 15:48:30','0','0','',''); -- id=35
UPDATE client SET  inUse = 0 where clientid = 5;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 7;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('430','07429', '20', '19', '833', '20', '450', '9000', '0', '', '0', '2026-09-30 17:19:46', '833', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','7-20,','1','1','0','0','450','9000','0','','0','0.00','0','0','0','0'); -- id=83
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 83;
 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 (833, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, 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 = '44', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '833';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('833', '1', '20', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '64', '44', '1', '2026-09-30 17:19:46','0','0'); -- id=1550
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 6;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','01322', '20', '39', '1322', '10', '385', '3850', '0', '', '0', '2026-09-30 17:19:46', '1322', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6-10,','1','1','0','0','385','3850','0','','0','0.00','0','0','0','0'); -- id=84
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 84;
 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 (1322, '2026-09-30', 3850, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 3600, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3850, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1800
                        , returnSellVal = returnSellVal+0, 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 = '35', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1322';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1322', '1', '10', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '45', '35', '1', '2026-09-30 17:19:46','0','0'); -- id=1551
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 28;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('557.37','01334', '20', '8', '1334', '10.00', '585', '5850', '0', '', '0', '2026-09-30 17:19:46', '1334', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','28-10,','1','1','0','0','585','5850','0','','0','0.00','0','0','0','0'); -- id=85
UPDATE sellbilldetail SET  lastbuyprice = 565.00 , meanbuyprice = 565.00, lastbuyprice_withDiscount = 557.37, meanbuyprice_withDiscount = 557.37
        , lastbuyprice_withTax = 565, meanbuyprice_withTax = 565, lastbuyprice_withDiscountAndTax = 557.37
                where sellbilldetailid = 85;
 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 (1334, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5850, sellCostBuyPrice =sellCostBuyPrice+5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5850, sellCostBuyPrice =sellCostBuyPrice+5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1334';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1334', '1', '10', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '0', '1', '2026-09-30 17:19:46','0','0'); -- id=1552
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 21;
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 ('625','01341', '20', '28', '1341', '5.00', '645', '3225', '0', '', '0', '2026-09-30 17:19:46', '1341', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','21-5,','1','1','0','0','645','3225','0','','0','0.00','0','0','0','0'); -- id=86
UPDATE sellbilldetail SET  lastbuyprice = 625.00 , meanbuyprice = 625.00, lastbuyprice_withDiscount = 625.00, meanbuyprice_withDiscount = 625.00
        , lastbuyprice_withTax = 625, meanbuyprice_withTax = 625, lastbuyprice_withDiscountAndTax = 625
                where sellbilldetailid = 86;
 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 (1341, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1341';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1341', '1', '5', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '10', '1', '2026-09-30 17:19:46','0','0'); -- id=1553
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 19;
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 ('430','01339', '20', '28', '1339', '20.00', '450', '9000', '0', '', '0', '2026-09-30 17:19:46', '1339', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','19-20,','1','1','0','0','450','9000','0','','0','0.00','0','0','0','0'); -- id=87
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 87;
 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 (1339, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1339';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1339', '1', '20', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '25', '5', '1', '2026-09-30 17:19:46','0','0'); -- id=1554
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 24;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('510','09724', '20', '28', '945', '15.00', '530', '7950', '0', '', '0', '2026-09-30 17:19:46', '945', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','24-15,','1','1','0','0','530','7950','0','','0','0.00','0','0','0','0'); -- id=88
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 510
                where sellbilldetailid = 88;
 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 (945, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7950, sellCostBuyPrice =sellCostBuyPrice+7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7950, sellCostBuyPrice =sellCostBuyPrice+7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '945';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('945', '1', '15', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '35', '20', '1', '2026-09-30 17:19:46','0','0'); -- id=1555
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 20;
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 ('630','01340', '20', '28', '1340', '5.00', '650', '3250', '0', '', '0', '2026-09-30 17:19:46', '1340', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','20-5,','1','1','0','0','650','3250','0','','0','0.00','0','0','0','0'); -- id=89
UPDATE sellbilldetail SET  lastbuyprice = 630.00 , meanbuyprice = 630.00, lastbuyprice_withDiscount = 630.00, meanbuyprice_withDiscount = 630.00
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 630, lastbuyprice_withDiscountAndTax = 630
                where sellbilldetailid = 89;
 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 (1340, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1340';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1340', '1', '5', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '10', '1', '2026-09-30 17:19:46','0','0'); -- id=1556
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 18;
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 ('700','01338', '20', '28', '1338', '5.00', '720', '3600', '0', '', '0', '2026-09-30 17:19:46', '1338', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','18-5,','1','1','0','0','720','3600','0','','0','0.00','0','0','0','0'); -- id=90
UPDATE sellbilldetail SET  lastbuyprice = 700.00 , meanbuyprice = 700.00, lastbuyprice_withDiscount = 700.00, meanbuyprice_withDiscount = 700.00
        , lastbuyprice_withTax = 700, meanbuyprice_withTax = 700, lastbuyprice_withDiscountAndTax = 700
                where sellbilldetailid = 90;
 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 (1338, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1338';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1338', '1', '5', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '10', '1', '2026-09-30 17:19:46','0','0'); -- id=1557
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 36;
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 ('485','01344', '20', '31', '1344', '15.00', '505', '7575', '0', '', '0', '2026-09-30 17:19:46', '1344', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','36-15,','1','1','0','0','505','7575','0','','0','0.00','0','0','0','0'); -- id=91
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 485.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 485.00
        , lastbuyprice_withTax = 485, meanbuyprice_withTax = 485, lastbuyprice_withDiscountAndTax = 485
                where sellbilldetailid = 91;
 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 (1344, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7575, sellCostBuyPrice =sellCostBuyPrice+7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7275
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7575, sellCostBuyPrice =sellCostBuyPrice+7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7275
                        , returnSellVal = returnSellVal+0, 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 = '25', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1344', '1', '15', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '40', '25', '1', '2026-09-30 17:19:46','0','0'); -- id=1558
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 22;
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 ('750','01342', '20', '28', '1342', '5.00', '770', '3850', '0', '', '0', '2026-09-30 17:19:46', '1342', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','22-5,','1','1','0','0','770','3850','0','','0','0.00','0','0','0','0'); -- id=92
UPDATE sellbilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 750.00, meanbuyprice_withDiscount = 750.00
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 750, lastbuyprice_withDiscountAndTax = 750
                where sellbilldetailid = 92;
 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 (1342, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1342';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1342', '1', '5', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '5', '1', '2026-09-30 17:19:46','0','0'); -- id=1559
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 26;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('641.23','01332', '20', '8', '1332', '5.00', '670', '3350', '0', '', '0', '2026-09-30 17:19:46', '1332', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','26-5,','1','1','0','0','670','3350','0','','0','0.00','0','0','0','0'); -- id=93
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 641.23, meanbuyprice_withDiscount = 641.23
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 650, lastbuyprice_withDiscountAndTax = 641.23
                where sellbilldetailid = 93;
 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 (1332, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3350, sellCostBuyPrice =sellCostBuyPrice+3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3350, sellCostBuyPrice =sellCostBuyPrice+3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1332';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1332', '1', '5', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '10', '1', '2026-09-30 17:19:46','0','0'); -- id=1560
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 45;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('600','01353', '20', '31', '1353', '10.00', '620', '6200', '0', '', '0', '2026-09-30 17:19:46', '1353', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','45-10,','1','1','0','0','620','6200','0','','0','0.00','0','0','0','0'); -- id=94
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where sellbilldetailid = 94;
 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 (1353, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6200, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6200, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1353';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1353', '1', '10', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '25', '15', '1', '2026-09-30 17:19:46','0','0'); -- id=1561
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 23;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','01343', '20', '28', '1343', '5.00', '690', '3450', '0', '', '0', '2026-09-30 17:19:46', '1343', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','23-5,','1','1','0','0','690','3450','0','','0','0.00','0','0','0','0'); -- id=95
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 95;
 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 (1343, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3450, sellCostBuyPrice =sellCostBuyPrice+3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3450, sellCostBuyPrice =sellCostBuyPrice+3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1343';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1343', '1', '5', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '15', '1', '2026-09-30 17:19:46','0','0'); -- id=1562
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 25;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('591.9','01331', '20', '8', '1331', '5.00', '620', '3100', '0', '', '0', '2026-09-30 17:19:46', '1331', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','25-5,','1','1','0','0','620','3100','0','','0','0.00','0','0','0','0'); -- id=96
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 591.90, meanbuyprice_withDiscount = 591.90
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 591.9
                where sellbilldetailid = 96;
 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 (1331, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1331';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1331', '1', '5', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '15', '1', '2026-09-30 17:19:46','0','0'); -- id=1563
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 35;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('580','01330', '20', '37', '1330', '15.00', '600', '9000', '0', '', '0', '2026-09-30 17:19:46', '1330', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','35-15,','1','1','0','0','600','9000','0','','0','0.00','0','0','0','0'); -- id=97
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 580.00, meanbuyprice_withDiscount = 580.00
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where sellbilldetailid = 97;
 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 (1330, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '65', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1330';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1330', '1', '15', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '80', '65', '1', '2026-09-30 17:19:46','0','0'); -- id=1564
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+18 where id = 44;
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 ('615','01352', '20', '31', '1352', '18', '635', '11430', '0', '', '0', '2026-09-30 17:19:46', '1352', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','44-18,','1','1','0','0','635','11430','0','','0','0.00','0','0','0','0'); -- id=98
UPDATE sellbilldetail SET  lastbuyprice = 615.00 , meanbuyprice = 615.00, lastbuyprice_withDiscount = 615.00, meanbuyprice_withDiscount = 615.00
        , lastbuyprice_withTax = 615, meanbuyprice_withTax = 615, lastbuyprice_withDiscountAndTax = 615
                where sellbilldetailid = 98;
 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 (1352, '2026-09-30', 11430, 11070, 11070
                    , 11070, 11070, 11070, 11070
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 11070, 11070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11430, sellCostBuyPrice =sellCostBuyPrice+11070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11070, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11070
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11070
                        , returnSellVal = returnSellVal+0, 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+18
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 11430, 11070, 11070
                    , 11070, 11070, 11070, 11070
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11070, 11070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11430, sellCostBuyPrice =sellCostBuyPrice+11070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11070, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11070
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11070
                        , returnSellVal = returnSellVal+0, 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 = '2026-09-30 17:19:46' WHERE storedetailid = '1352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1352', '1', '18', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '30', '12', '1', '2026-09-30 17:19:46','0','0'); -- id=1565
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 34;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('570','01329', '20', '37', '1329', '10.00', '590', '5900', '0', '', '0', '2026-09-30 17:19:46', '1329', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','34-10,','1','1','0','0','590','5900','0','','0','0.00','0','0','0','0'); -- id=99
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 99;
 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 (1329, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5900, sellCostBuyPrice =sellCostBuyPrice+5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5900, sellCostBuyPrice =sellCostBuyPrice+5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1329';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1329', '1', '10', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '40', '30', '1', '2026-09-30 17:19:46','0','0'); -- id=1566
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+25 where id = 5;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','01321', '20', '39', '1321', '25', '400', '10000', '0', '', '0', '2026-09-30 17:19:46', '1321', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','5-25,','1','1','0','0','400','10000','0','','0','0.00','0','0','0','0'); -- id=100
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        , lastbuyprice_withTax = 375, meanbuyprice_withTax = 187.5, lastbuyprice_withDiscountAndTax = 375
                where sellbilldetailid = 100;
 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 (1321, '2026-09-30', 10000, 9375, 9375
                    , 9375, 9375, 9375, 9375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 25, 0, 9375, 4687.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10000, sellCostBuyPrice =sellCostBuyPrice+9375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9375
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4687.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+25
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 10000, 9375, 9375
                    , 9375, 9375, 9375, 9375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9375, 4687.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10000, sellCostBuyPrice =sellCostBuyPrice+9375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9375
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4687.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1321';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1321', '1', '25', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '45', '20', '1', '2026-09-30 17:19:46','0','0'); -- id=1567
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+30 where id = 37;
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 ('570','01345', '20', '31', '1345', '30', '590', '17700', '0', '', '0', '2026-09-30 17:19:46', '1345', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','37-30,','1','1','0','0','590','17700','0','','0','0.00','0','0','0','0'); -- id=101
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 101;
 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 (1345, '2026-09-30', 17700, 17100, 17100
                    , 17100, 17100, 17100, 17100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 17100, 17100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17700, sellCostBuyPrice =sellCostBuyPrice+17100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+30
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 17700, 17100, 17100
                    , 17100, 17100, 17100, 17100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 17100, 17100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17700, sellCostBuyPrice =sellCostBuyPrice+17100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17100
                        , returnSellVal = returnSellVal+0, 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 = '18', userid = '1', storedetaildate = '2026-09-30 17:19:46' WHERE storedetailid = '1345';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1345', '1', '30', '1', '20', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '48', '18', '1', '2026-09-30 17:19:46','0','0'); -- id=1568
UPDATE dailyentry SET totalcreditor = '129345.00', totaldebtor = '129345.00', thedate = '2026-09-30', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 17:08:56', entryComment = 'اضافة فاتورة مبيعات رقم 19', fromFlag = '1',related='0',isopeningentry='0',operationId='19',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=19' WHERE id = '829';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '129345.00', '129345.00', '2026-09-30', '1', '0', '829', '2026-09-30 17:19:46','تم عكس القيد رقم 829 ','1','0','0','0','0',''); -- id=834
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('834', '497', '129345.00', '','0'); -- id=834
UPDATE accountstree SET name = 'محل VIP', customName = 'محل VIP', customNameEn = 'محل VIP', nameEn = 'محل VIP', parent = '58', accountNature = '0', theValue = '-129345', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:40:12' WHERE id = '497';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('834', '143', '129345.00', '','0'); -- id=835
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '152105', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
UPDATE dailyentry SET totalcreditor = '129345.00', totaldebtor = '129345.00', thedate = '2026-09-30', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 17:08:56', entryComment = 'اضافة فاتورة مبيعات رقم 19 - تحصيل الفاتورة من العميل', fromFlag = '1',related='0',isopeningentry='0',operationId='19',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=19' WHERE id = '830';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '129345.00', '129345.00', '2026-09-30', '1', '0', '830', '2026-09-30 17:19:46','تم عكس القيد رقم 830 ','1','0','0','0','0',''); -- id=835
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('835', '419', '129345.00', '','0'); -- id=835
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '131855', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('835', '497', '129345.00', '','0'); -- id=836
UPDATE accountstree SET name = 'محل VIP', customName = 'محل VIP', customNameEn = 'محل VIP', nameEn = 'محل VIP', parent = '58', accountNature = '0', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:40:12' WHERE id = '497';
UPDATE dailyentry SET totalcreditor = '124199.35', totaldebtor = '124199.35', thedate = '2026-09-30', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 17:08:56', entryComment = 'اضافة فاتورة مبيعات رقم 19 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='19',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=19' WHERE id = '831';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '124199.35', '124199.35', '2026-09-30', '1', '0', '831', '2026-09-30 17:19:46','تم عكس القيد رقم 831 ','1','0','0','0','0',''); -- id=836
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('836', '402', '124199.35', '','0'); -- id=836
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '149770', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('836', '382', '124199.35', '','0'); -- id=837
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12848265', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '127280', '127280', '2026-09-30', '1', '0', '0', '2026-09-30 17:19:46','اضافة فاتورة مبيعات رقم 20','1','0',null,'0','20','sellbillController.php?do=showDetail&sellbillid=20'); -- id=837
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('837', '497', '127280', '','0'); -- id=838
UPDATE accountstree SET name = 'محل VIP', customName = 'محل VIP', customNameEn = 'محل VIP', nameEn = 'محل VIP', parent = '58', accountNature = '0', theValue = '127280', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:40:12' WHERE id = '497';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('837', '143', '127280', '','0'); -- id=837
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '279385', 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 ( '122284.35', '122284.35', '2026-09-30', '1', '0', '0', '2026-09-30 17:19:46','اضافة فاتورة مبيعات رقم 20 - صرف البضاعة من المخزن','1','0',null,'0','20','sellbillController.php?do=showDetail&sellbillid=20'); -- id=838
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('838', '402', '122284.35', '','0'); -- id=839
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '272054.35', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('838', '382', '122284.35', '','0'); -- id=838
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12725980.65', 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='837,0,838' where sellbillid=20;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 127280, 122445, 122445
                    , 122445, 122284.35, 122284.35, 122284.35
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,122445, 115957.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+127280, sellCostBuyPrice =sellCostBuyPrice+122445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+122445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+122445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+122284.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+122284.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+122284.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+122445
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115957.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5, '2026-09-30', 127280, 122445, 122445
                    , 122445, 122284.35, 122284.35, 122284.35
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,122445, 115957.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+127280, sellCostBuyPrice =sellCostBuyPrice+122445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+122445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+122445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+122284.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+122284.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+122284.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+122445
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115957.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 127280, 122445, 122445
                    , 122445, 122284.35, 122284.35, 122284.35, 122445, 115957.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+127280, netSellCostBuyPrice = netSellCostBuyPrice+122445
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+122445
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+122445
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+122284.35
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+122284.35
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+122284.35
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+122445
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+115957.5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 19 and newid=20 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:49:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:19:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:19:46', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editprint&id=20'); -- id=1288
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:50:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:20:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:20:33', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1289

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abd14ca666f8
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 17:20:33', '06abd14ca666f8', '1', '0.00', '0', '0', '1', '28615.00', '28615', '28615', '0', '1', '2026-09-30 17:20:33', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'محل عروض', '87' ,'0','','','','','-1','0','0','0','0','0','28615','0','','0','0','28615','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-30','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=21
UPDATE client SET  clientdebt = '0', userid = '2' 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','اضافة فاتورة مبيعات','21', '0', '2026-09-30 17:20:33', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '28615', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 17:20:33','0','0','',''); -- id=36
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 ('315','78068', '21', '19', '834', '25', '335', '8375', '0', '', '0', '2026-09-30 17:20:33', '834', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','335','8375','0','','0','0.00','0','0','0','0'); -- id=102
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 102;
 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 (834, '2026-09-30', 8375, 7875, 7875
                    , 7875, 7875, 7875, 7875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 25, 0, 7875, 7875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8375, sellCostBuyPrice =sellCostBuyPrice+7875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7875
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+25
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 8375, 7875, 7875
                    , 7875, 7875, 7875, 7875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7875, 7875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8375, sellCostBuyPrice =sellCostBuyPrice+7875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7875
                        , returnSellVal = returnSellVal+0, 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 = '25', userid = '2', storedetaildate = '2026-09-30 17:20:33' WHERE storedetailid = '834';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('834', '1', '25', '1', '21', 'اضافة فاتورة مبيعات', 'sellbillController.php', '50', '25', '2', '2026-09-30 17:20:33','0','0'); -- id=1569
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 ('340','08354', '21', '13', '784', '4', '360', '1440', '0', '', '0', '2026-09-30 17:20:33', '784', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','360','1440','0','','0','0.00','0','0','0','0'); -- id=103
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 103;
 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 (784, '2026-09-30', 1440, 1360, 1360
                    , 1360, 1360, 1360, 1360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1360, 1360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440, sellCostBuyPrice =sellCostBuyPrice+1360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1440, 1360, 1360
                    , 1360, 1360, 1360, 1360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1360, 1360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440, sellCostBuyPrice =sellCostBuyPrice+1360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2026-09-30 17:20:33' WHERE storedetailid = '784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('784', '1', '4', '1', '21', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '15', '2', '2026-09-30 17:20:33','0','0'); -- id=1570
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 ('320','08564', '21', '25', '893', '20', '340', '6800', '0', '', '0', '2026-09-30 17:20:33', '893', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','340','6800','0','','0','0.00','0','0','0','0'); -- id=104
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 104;
 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 (893, '2026-09-30', 6800, 6400, 6400
                    , 6400, 6400, 6400, 6400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 6400, 6400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6800, sellCostBuyPrice =sellCostBuyPrice+6400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6800, 6400, 6400
                    , 6400, 6400, 6400, 6400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6400, 6400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6800, sellCostBuyPrice =sellCostBuyPrice+6400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-09-30 17:20:33' WHERE storedetailid = '893';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('893', '1', '20', '1', '21', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '0', '2', '2026-09-30 17:20:33','0','0'); -- id=1571
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 ('295','08585', '21', '13', '775', '12', '315', '3780', '0', '', '0', '2026-09-30 17:20:33', '775', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','315','3780','0','','0','0.00','0','0','0','0'); -- id=105
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 295.00
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 295
                where sellbilldetailid = 105;
 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 (775, '2026-09-30', 3780, 3540, 3540
                    , 3540, 3540, 3540, 3540
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3540, 3540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3540
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3780, 3540, 3540
                    , 3540, 3540, 3540, 3540
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3540, 3540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3540
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '2', storedetaildate = '2026-09-30 17:20:33' WHERE storedetailid = '775';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('775', '1', '12', '1', '21', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '8', '2', '2026-09-30 17:20:33','0','0'); -- id=1572
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('275','07110', '21', '40', '1129', '6', '295', '1770', '0', '', '0', '2026-09-30 17:20:33', '1129', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','295','1770','0','','0','0.00','0','0','0','0'); -- id=106
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 275, lastbuyprice_withDiscountAndTax = 275
                where sellbilldetailid = 106;
 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 (1129, '2026-09-30', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+6
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1650
                        , returnSellVal = returnSellVal+0, 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 = '632', userid = '2', storedetaildate = '2026-09-30 17:20:33' WHERE storedetailid = '1129';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1129', '1', '6', '1', '21', 'اضافة فاتورة مبيعات', 'sellbillController.php', '638', '632', '2', '2026-09-30 17:20:33','0','0'); -- id=1573
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 ('300','08562', '21', '25', '891', '15', '320', '4800', '0', '', '0', '2026-09-30 17:20:33', '891', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','320','4800','0','','0','0.00','0','0','0','0'); -- id=107
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 107;
 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 (891, '2026-09-30', 4800, 4500, 4500
                    , 4500, 4500, 4500, 4500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 4500, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4800, sellCostBuyPrice =sellCostBuyPrice+4500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 4800, 4500, 4500
                    , 4500, 4500, 4500, 4500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4500, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4800, sellCostBuyPrice =sellCostBuyPrice+4500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4500
                        , returnSellVal = returnSellVal+0, 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 = '2', storedetaildate = '2026-09-30 17:20:33' WHERE storedetailid = '891';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('891', '1', '15', '1', '21', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '10', '2', '2026-09-30 17:20:33','0','0'); -- id=1574
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 ('310','07114', '21', '36', '1080', '5', '330', '1650', '0', '', '0', '2026-09-30 17:20:33', '1080', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','330','1650','0','','0','0.00','0','0','0','0'); -- id=108
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 310, lastbuyprice_withDiscountAndTax = 310
                where sellbilldetailid = 108;
 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 (1080, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1550
                        , returnSellVal = returnSellVal+0, 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 = '40', userid = '2', storedetaildate = '2026-09-30 17:20:33' WHERE storedetailid = '1080';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1080', '1', '5', '1', '21', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '40', '2', '2026-09-30 17:20:33','0','0'); -- id=1575
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '160470',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('131855','28615', '0', '2', 'اضافة فاتورة مبيعات', '21', '160470', '2026-09-30 17:20:33', '2',  'sellbillController.php','1','','0'); -- id=34
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '28615', '28615', '2026-09-30', '2', '0', '0', '2026-09-30 17:20:33','اضافة فاتورة مبيعات رقم 21','1','0',null,'0','21','sellbillController.php?do=showDetail&sellbillid=21'); -- id=839
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('839', '419', '28615', '','0'); -- id=840
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '160470', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('839', '143', '28615', '','0'); -- id=839
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '308000', 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 ( '26875', '26875', '2026-09-30', '2', '0', '0', '2026-09-30 17:20:33','اضافة فاتورة مبيعات رقم 21 - صرف البضاعة من المخزن','1','0',null,'0','21','sellbillController.php?do=showDetail&sellbillid=21'); -- id=840
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('840', '402', '26875', '','0'); -- id=841
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '298929.35', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('840', '382', '26875', '','0'); -- id=840
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12699105.65', 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='839,0,840' where sellbillid=21;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,26875, 26875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+28615, sellCostBuyPrice =sellCostBuyPrice+26875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+26875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+26875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+26875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26875
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,26875, 26875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+28615, sellCostBuyPrice =sellCostBuyPrice+26875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+26875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+26875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+26875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26875
                        , returnSellVal = returnSellVal+0, 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, 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875, 26875, 26875)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+28615, netSellCostBuyPrice = netSellCostBuyPrice+26875
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+26875
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+26875
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+26875
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+26875
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+26875
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+26875
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+26875;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abd14ca666f8 and sellbillId = 21 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:50:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:20:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:20:33', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1290
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:51:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:21:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:21:21', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=20'); -- id=1291
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:51:32";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:21:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:21:32', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=20'); -- id=1292
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:51:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:21:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:21:36', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=16'); -- id=1293
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:51:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:21:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:21:42', '2', 'showDetail', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=21'); -- id=1294
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:51:58";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:21:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 17:21:58', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1295
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:51:58";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-09-30 17:21:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 17:21:58', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1296
UPDATE user SET loginip = "" WHERE userid = 2;
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:52:15";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:22:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 17:22:15', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1297
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:52:15";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 17:22:15', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1298
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:52:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:22:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:22:28', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1299
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:52:31";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:22:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:22:31', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1300
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:52:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:22:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:22:36', '1', 'showDetail', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=20'); -- id=1301
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:52:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:22:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 17:22:57', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1302
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:52:57";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-09-30 17:22:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 17:22:57', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1303
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 13:55:27";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:25:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 17:25:27', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1304
UPDATE user SET loginip = "" WHERE userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:14:33";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:14:35";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:44:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 17:44:35', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1305
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:14:35";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 17:44:35', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1306
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:24:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:54:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 17:54:17', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=1307
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:24:49";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:54:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-09-30 17:54:49', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=1308
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:25:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:55:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 17:55:56', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1309
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:26:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 17:56:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 17:56:56', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1310
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:34:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:04:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-09-30 18:04:00', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=show'); -- id=1311
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:34:10";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:04:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-09-30 18:04:10', '1', 'edit', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=edit&id=3'); -- id=1312
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:34:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:04:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-09-30 18:04:16', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=update'); -- id=1313
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:34:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:04:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-09-30 18:04:16', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=sucess'); -- id=1314
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:34:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:04:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-09-30 18:04:18', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=show'); -- id=1315
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:34:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:04:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-09-30 18:04:20', '1', 'edit', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=edit&id=3'); -- id=1316
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:35:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:05:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-09-30 18:05:03', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=update'); -- id=1317
UPDATE usergroup SET priceupdate=1 WHERE usergroupid = 3;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:35:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:05:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-09-30 18:05:03', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=sucess'); -- id=1318
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:35:05";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:05:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-09-30 18:05:05', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=show'); -- id=1319
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:38:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:08:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 18:08:17', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1320
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:38:17";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-09-30 18:08:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 18:08:17', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1321
UPDATE user SET loginip = "" WHERE userid = 2;
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:38:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:08:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 18:08:50', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1322
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:38:50";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 18:08:50', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1323
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:39:22";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:09:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 18:09:22', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=1324
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:39:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:09:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 18:09:43', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1325
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:39:44";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 18:09:44', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1326
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:39:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:09:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 18:09:45', '1', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1327
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:40:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:10:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-09-30 18:10:13', '1', 'autosave', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php?do=autosave'); -- id=1328
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2026-09-30' WHERE storedetailid = '1141';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1141', '1', '1', '0', '-1', 'تم إعادة جرد المنتج بالقيمة الحالية بالزيادة', 'inventoryController.php', '7', '8', '1', '2026-09-30','0','0'); -- id=1576
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '250', '250', '2026-09-30', '1', '0', '0', '2026-09-30 18:10:13','اعادة جرد للمنتج : (ميلتون نايك قصات اباتشي/اباتشي) فى مخزن : (المخزن الرئيسي) بالكمية : 8','1','0',null,'0','1576','inventoryController.php?do=details&id=1576'); -- id=841
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('841', '382', '250', '','0'); -- id=842
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12699355.65', 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 ('841', '188', '250', '','0'); -- id=841
UPDATE accountstree SET name = 'عجز وزيادة المخزون', customName = 'عجز وزيادة المخزون', customNameEn = '', nameEn = '', parent = '159', accountNature = '0', theValue = '122075', theOrder = '0', layingOrder = '5302', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2023-07-11 01:08:03' WHERE id = '188';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:43:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:13:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 18:13:50', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1329
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:45:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:15:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 18:15:16', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=1330
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('وايد ليج ريب سيفن ار','','71','250','260','260','260','2026-09-30','0','1','0','08345','0','0','0','0','0','250','250','250','250','250','0','4','0','0','.','0','0','0','250','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','250','250','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','250','0','0','0','0','0','0','','','0','0','0','0'); -- id=1360
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1360', '1', '2026-09-30', '1', '0','0136001','260','260','260','250','','0','0','0','0','0','0','0','0','0','0'); -- id=1360
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1360', '1', '4', '1', '2026-09-30'); -- id=1360
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1360', '1', '4', '0', '1360', 'إضافة منتج', 'productController.php', '0', '4', '1', '2026-09-30','0','0'); -- id=1577
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1360, 1,'2026-09-30 18:15:16',1)
                ON DUPLICATE KEY UPDATE productid = 1360, edited = 1, sysdate = '2026-09-30 18:15:16', userid = 1; -- id=2035
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1000', '1000', '2026-09-30', '1', '0', '0', '2026-09-30 18:15:16','إضافة منتج وايد ليج ريب سيفن ار الكمية 4','1','0','0','0','1360','productController.php?do=edit&id=1360'); -- id=842
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('842', '382', '1000', '','0'); -- id=843
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12700355.65', 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 ('842', '121', '1000', '','0'); -- id=842
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '-2839433.55', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
UPDATE product SET productName = 'وايد ليج ريب سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '250.00', productSellAllPrice = '260.00', productSellUnitPrice = '260.00', productSellHalfPrice = '260.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '08345',type ='0', expireDate = '0' , dailyentryId = '842',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '250',meanbuyprice = '250',meanbuyprice_withDiscount = '250' , productbuypricereal = '250' , buypricereal_precentage = '0' , buytotal_precentage = '4' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='250',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='250',meanbuyprice_withTax='250',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='250',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1360';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:45:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:15:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 18:15:17', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1331
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:45:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:15:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 18:15:55', '1', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1332

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abd2639c3ce5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 18:15:55', '06abd2639c3ce5', '1', '0.00', '0', '0', '1', '10340.00', '10340', '10340', '0', '1', '2026-09-30 18:15:55', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'عروض الفيوم', '39' ,'0','','','','','-1','0','0','0','0','0','10340','0','','0','0','10340','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-30','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=22
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','اضافة فاتورة مبيعات','22', '0', '2026-09-30 18:15:55', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '10340', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 18:15:55','0','0','',''); -- id=37
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 ('315','05944', '22', '42', '1139', '4', '285', '1140', '0', '', '0', '2026-09-30 18:15:55', '1139', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','285','1140','0','','0','0.00','0','0','0','0'); -- id=109
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 109;
 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 (1139, '2026-09-30', 1140, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1140, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1140, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1140, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2026-09-30 18:15:55' WHERE storedetailid = '1139';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1139', '1', '4', '1', '22', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '4', '1', '2026-09-30 18:15:55','0','0'); -- id=1578
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 ('315','05944', '22', '42', '1139', '4', '285', '1140', '0', '', '0', '2026-09-30 18:15:55', '1139', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','285','1140','0','','0','0.00','0','0','0','0'); -- id=110
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 110;
 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 (1139, '2026-09-30', 1140, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1140, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1140, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1140, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 18:15:55' WHERE storedetailid = '1139';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1139', '1', '4', '1', '22', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '0', '1', '2026-09-30 18:15:55','0','0'); -- id=1579
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 ('240','07891', '22', '72', '1250', '12', '200', '2400', '0', '', '0', '2026-09-30 18:15:55', '1250', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','200','2400','0','','0','0.00','0','0','0','0'); -- id=111
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 111;
 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 (1250, '2026-09-30', 2400, 2880, 2880
                    , 2880, 2880, 2880, 2880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 2880, 2880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2400, 2880, 2880
                    , 2880, 2880, 2880, 2880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2880, 2880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2026-09-30 18:15:55' WHERE storedetailid = '1250';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1250', '1', '12', '1', '22', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '3', '1', '2026-09-30 18:15:55','0','0'); -- id=1580
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 ('330','05504', '22', '42', '1136', '7', '300', '2100', '0', '', '0', '2026-09-30 18:15:55', '1136', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','300','2100','0','','0','0.00','0','0','0','0'); -- id=112
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 112;
 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 (1136, '2026-09-30', 2100, 2310, 2310
                    , 2310, 2310, 2310, 2310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7, 0, 2310, 2310, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2310
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+7
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2100, 2310, 2310
                    , 2310, 2310, 2310, 2310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2310, 2310, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2310
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 18:15:55' WHERE storedetailid = '1136';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1136', '1', '7', '1', '22', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '0', '1', '2026-09-30 18:15:55','0','0'); -- id=1581
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 ('350','08549', '22', '42', '1145', '4', '370', '1480', '0', '', '0', '2026-09-30 18:15:55', '1145', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','370','1480','0','','0','0.00','0','0','0','0'); -- id=113
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 113;
 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 (1145, '2026-09-30', 1480, 1400, 1400
                    , 1400, 1400, 1400, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1400, 1400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1480, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1480, 1400, 1400
                    , 1400, 1400, 1400, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1400, 1400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1480, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 18:15:55' WHERE storedetailid = '1145';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1145', '1', '4', '1', '22', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '0', '1', '2026-09-30 18:15:55','0','0'); -- id=1582
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 ('360','08568', '22', '71', '1245', '4', '260', '1040', '0', '', '0', '2026-09-30 18:15:55', '1245', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','260','1040','0','','0','0.00','0','0','0','0'); -- id=114
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 355.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 355.00
        , lastbuyprice_withTax = 355, meanbuyprice_withTax = 355, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 114;
 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 (1245, '2026-09-30', 1040, 1440, 1400
                    , 1420, 1400, 1420, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1420, 1420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1040, 1440, 1400
                    , 1420, 1400, 1420, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1420, 1420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 18:15:55' WHERE storedetailid = '1245';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1245', '1', '4', '1', '22', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '0', '1', '2026-09-30 18:15:55','0','0'); -- id=1583
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','08345', '22', '71', '1360', '4', '260', '1040', '0', '', '0', '2026-09-30 18:15:55', '1360', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','260','1040','0','','0','0.00','0','0','0','0'); -- id=115
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 115;
 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 (1360, '2026-09-30', 1040, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1040, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 18:15:55' WHERE storedetailid = '1360';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1360', '1', '4', '1', '22', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '0', '1', '2026-09-30 18:15:55','0','0'); -- id=1584
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-1019560',  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 ('-1029900','10340', '0', '1', 'اضافة فاتورة مبيعات', '22', '-1019560', '2026-09-30 18:15:55', '1',  'sellbillController.php','1','','0'); -- id=35
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10340', '10340', '2026-09-30', '1', '0', '0', '2026-09-30 18:15:55','اضافة فاتورة مبيعات رقم 22','1','0',null,'0','22','sellbillController.php?do=showDetail&sellbillid=22'); -- id=843
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('843', '383', '10340', '','0'); -- id=844
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-1019560', 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 ('843', '143', '10340', '','0'); -- id=843
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '318340', 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 ( '11510', '11510', '2026-09-30', '1', '0', '0', '2026-09-30 18:15:55','اضافة فاتورة مبيعات رقم 22 - صرف البضاعة من المخزن','1','0',null,'0','22','sellbillController.php?do=showDetail&sellbillid=22'); -- id=844
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('844', '402', '11510', '','0'); -- id=845
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '310439.35', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('844', '382', '11510', '','0'); -- id=844
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12688845.65', 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='843,0,844' where sellbillid=22;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 10340, 11550, 11510
                    , 11530, 11510, 11530, 11510
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11530, 11530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10340, sellCostBuyPrice =sellCostBuyPrice+11550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11530
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 10340, 11550, 11510
                    , 11530, 11510, 11530, 11510
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11530, 11530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10340, sellCostBuyPrice =sellCostBuyPrice+11550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11530
                        , returnSellVal = returnSellVal+0, 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, 10340, 11550, 11510
                    , 11530, 11510, 11530, 11510, 11530, 11530)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+10340, netSellCostBuyPrice = netSellCostBuyPrice+11550
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+11510
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+11530
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+11510
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+11530
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+11510
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+11530
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+11530;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abd2639c3ce5 and sellbillId = 22 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:45:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:15:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 18:15:55', '1', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1333
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:46:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:16:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 18:16:04', '1', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1334
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:46:52";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:16:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 18:16:52', '1', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1335

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abd27b46357b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 18:16:52', '06abd27b46357b', '1', '0.00', '0', '0', '1', '5150.00', '5150', '5150', '0', '1', '2026-09-30 18:16:52', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '22' ,'0','','','','','-1','0','0','0','0','0','5150','0','','0','0','5150','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-30','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=23
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','اضافة فاتورة مبيعات','23', '0', '2026-09-30 18:16:52', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5150', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 18:16:52','0','0','',''); -- id=38
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 ('240','07891', '23', '72', '1250', '3', '200', '600', '0', '', '0', '2026-09-30 18:16:52', '1250', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','200','600','0','','0','0.00','0','0','0','0'); -- id=116
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 116;
 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 (1250, '2026-09-30', 600, 720, 720
                    , 720, 720, 720, 720
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 720, 720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+720
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+720
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+720
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 600, 720, 720
                    , 720, 720, 720, 720
                    , 0, 0, 0, 0
                    , 0, 0, 0, 720, 720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+600, sellCostBuyPrice =sellCostBuyPrice+720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+720
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+720
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+720
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 18:16:52' WHERE storedetailid = '1250';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1250', '1', '3', '1', '23', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '0', '1', '2026-09-30 18:16:52','0','0'); -- id=1585
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 46;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','09745', '23', '71', '1247', '4', '200', '800', '0', '', '0', '2026-09-30 18:16:52', '1247', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','46-4,','1','1','0','0','200','800','0','','0','0.00','0','0','0','0'); -- id=117
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 188.64, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 188.64
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 188.64, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 117;
 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 (1247, '2026-09-30', 800, 760, 760
                    , 754.56, 760, 754.56, 760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 760, 754.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+800, sellCostBuyPrice =sellCostBuyPrice+760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+754.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+754.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+754.56
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 800, 760, 760
                    , 754.56, 760, 754.56, 760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 760, 754.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+800, sellCostBuyPrice =sellCostBuyPrice+760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+754.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+754.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+754.56
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '155', userid = '1', storedetaildate = '2026-09-30 18:16:52' WHERE storedetailid = '1247';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1247', '1', '4', '1', '23', 'اضافة فاتورة مبيعات', 'sellbillController.php', '159', '155', '1', '2026-09-30 18:16:52','0','0'); -- id=1586
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 ('290','09267', '23', '48', '1177', '15', '250', '3750', '0', '', '0', '2026-09-30 18:16:52', '1177', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','250','3750','0','','0','0.00','0','0','0','0'); -- id=118
UPDATE sellbilldetail SET  lastbuyprice = 290.00 , meanbuyprice = 290.00, lastbuyprice_withDiscount = 290.00, meanbuyprice_withDiscount = 290.00
        , lastbuyprice_withTax = 290, meanbuyprice_withTax = 290, lastbuyprice_withDiscountAndTax = 290
                where sellbilldetailid = 118;
 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 (1177, '2026-09-30', 3750, 4350, 4350
                    , 4350, 4350, 4350, 4350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 4350, 4350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3750, sellCostBuyPrice =sellCostBuyPrice+4350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3750, 4350, 4350
                    , 4350, 4350, 4350, 4350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4350, 4350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3750, sellCostBuyPrice =sellCostBuyPrice+4350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4350
                        , returnSellVal = returnSellVal+0, 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 = '27', userid = '1', storedetaildate = '2026-09-30 18:16:52' WHERE storedetailid = '1177';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1177', '1', '15', '1', '23', 'اضافة فاتورة مبيعات', 'sellbillController.php', '42', '27', '1', '2026-09-30 18:16:52','0','0'); -- id=1587
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-1014410',  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 ('-1019560','5150', '0', '1', 'اضافة فاتورة مبيعات', '23', '-1014410', '2026-09-30 18:16:52', '1',  'sellbillController.php','1','','0'); -- id=36
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5150', '5150', '2026-09-30', '1', '0', '0', '2026-09-30 18:16:52','اضافة فاتورة مبيعات رقم 23','1','0',null,'0','23','sellbillController.php?do=showDetail&sellbillid=23'); -- id=845
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('845', '383', '5150', '','0'); -- id=846
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-1014410', 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 ('845', '143', '5150', '','0'); -- id=845
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '323490', 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 ( '5830', '5830', '2026-09-30', '1', '0', '0', '2026-09-30 18:16:52','اضافة فاتورة مبيعات رقم 23 - صرف البضاعة من المخزن','1','0',null,'0','23','sellbillController.php?do=showDetail&sellbillid=23'); -- id=846
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('846', '402', '5830', '','0'); -- id=847
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '316269.35', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('846', '382', '5830', '','0'); -- id=846
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12683015.65', 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='845,0,846' where sellbillid=23;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 5150, 5830, 5830
                    , 5824.56, 5830, 5824.56, 5830
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5830, 5824.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5150, sellCostBuyPrice =sellCostBuyPrice+5830
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5830, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5824.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5830, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5824.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5830
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5830
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5824.56
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5150, 5830, 5830
                    , 5824.56, 5830, 5824.56, 5830
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5830, 5824.56, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5150, sellCostBuyPrice =sellCostBuyPrice+5830
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5830, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5824.56
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5830, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5824.56
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5830
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5830
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5824.56
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 5150, 5830, 5830
                    , 5824.56, 5830, 5824.56, 5830, 5830, 5824.56)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5150, netSellCostBuyPrice = netSellCostBuyPrice+5830
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+5830
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+5824.56
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5830
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+5824.56
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+5830
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+5830
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5824.56;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abd27b46357b and sellbillId = 23 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:46:52";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:16:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 18:16:52', '1', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1336
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:47:25";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:17:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 18:17:25', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1337
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:47:25";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 18:17:26', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1338
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 < "2026-09-30 14:47:34";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:17:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 18:17:34', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1339
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:47:34";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-09-30 18:17:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 18:17:34', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1340
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:47:37";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:17:37", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 18:17:37', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1341
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:49:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:19:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 18:19:40', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=23'); -- id=1342
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:49:49";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:19:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 18:19:49', '2', 'showDetail', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=23'); -- id=1343
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:50:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:20:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 18:20:39', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1344
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:50:39";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-09-30 18:20:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 18:20:39', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1345
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 14:50:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:20:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 18:20:42', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1346
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 15:03:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:33:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 18:33:45', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1347

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abd28ca5a6b5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 18:33:45', '06abd28ca5a6b5', '1', '0.00', '0', '0', '1', '30260.00', '30260', '30260', '0', '1', '2026-09-30 18:33:45', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'عروض', '127' ,'0','','','','','-1','0','0','0','0','0','30260','0','','0','0','30260','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-30','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=24
UPDATE client SET  clientdebt = '0', userid = '2' 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','اضافة فاتورة مبيعات','24', '0', '2026-09-30 18:33:45', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '30260', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 18:33:45','0','0','',''); -- id=39
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 ('230','05645', '24', '42', '1137', '4', '250', '1000', '0', '', '0', '2026-09-30 18:33:45', '1137', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','250','1000','0','','0','0.00','0','0','0','0'); -- id=119
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 119;
 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 (1137, '2026-09-30', 1000, 920, 920
                    , 920, 920, 920, 920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 920, 920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1000, 920, 920
                    , 920, 920, 920, 920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 920, 920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-09-30 18:33:45' WHERE storedetailid = '1137';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1137', '1', '4', '1', '24', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '0', '2', '2026-09-30 18:33:45','0','0'); -- id=1588
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06700', '24', '42', '1141', '8', '270', '2160', '0', '', '0', '2026-09-30 18:33:45', '1141', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','270','2160','0','','0','0.00','0','0','0','0'); -- id=120
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 120;
 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 (1141, '2026-09-30', 2160, 2000, 2000
                    , 2000, 2000, 2000, 2000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2160, 2000, 2000
                    , 2000, 2000, 2000, 2000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-09-30 18:33:45' WHERE storedetailid = '1141';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1141', '1', '8', '1', '24', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '0', '2', '2026-09-30 18:33:45','0','0'); -- id=1589
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 ('265','07835', '24', '42', '1144', '8', '285', '2280', '0', '', '0', '2026-09-30 18:33:45', '1144', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','285','2280','0','','0','0.00','0','0','0','0'); -- id=121
UPDATE sellbilldetail SET  lastbuyprice = 265.00 , meanbuyprice = 265.00, lastbuyprice_withDiscount = 265.00, meanbuyprice_withDiscount = 265.00
        , lastbuyprice_withTax = 265, meanbuyprice_withTax = 265, lastbuyprice_withDiscountAndTax = 265
                where sellbilldetailid = 121;
 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 (1144, '2026-09-30', 2280, 2120, 2120
                    , 2120, 2120, 2120, 2120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2120, 2120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2280, sellCostBuyPrice =sellCostBuyPrice+2120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2280, 2120, 2120
                    , 2120, 2120, 2120, 2120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2120, 2120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2280, sellCostBuyPrice =sellCostBuyPrice+2120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-09-30 18:33:45' WHERE storedetailid = '1144';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1144', '1', '8', '1', '24', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8', '0', '2', '2026-09-30 18:33:45','0','0'); -- id=1590
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+33 where id = 46;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','09745', '24', '71', '1247', '33', '200', '6600', '0', '', '0', '2026-09-30 18:33:45', '1247', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','46-33,','1','1','0','0','200','6600','0','','0','0.00','0','0','0','0'); -- id=122
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 188.64, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 188.64
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 188.64, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 122;
 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 (1247, '2026-09-30', 6600, 6270, 6270
                    , 6225.12, 6270, 6225.12, 6270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 33, 0, 6270, 6225.12, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6600, sellCostBuyPrice =sellCostBuyPrice+6270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6225.12
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6225.12
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6225.12
                        , returnSellVal = returnSellVal+0, 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+33
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6600, 6270, 6270
                    , 6225.12, 6270, 6225.12, 6270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6270, 6225.12, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6600, sellCostBuyPrice =sellCostBuyPrice+6270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6225.12
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6225.12
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6225.12
                        , returnSellVal = returnSellVal+0, 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 = '122', userid = '2', storedetaildate = '2026-09-30 18:33:45' WHERE storedetailid = '1247';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1247', '1', '33', '1', '24', 'اضافة فاتورة مبيعات', 'sellbillController.php', '155', '122', '2', '2026-09-30 18:33:45','0','0'); -- id=1591
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 ('370','09274', '24', '62', '1215', '18', '390', '7020', '0', '', '0', '2026-09-30 18:33:45', '1215', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','390','7020','0','','0','0.00','0','0','0','0'); -- id=123
UPDATE sellbilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 370.00, meanbuyprice_withDiscount = 370.00
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 370
                where sellbilldetailid = 123;
 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 (1215, '2026-09-30', 7020, 6660, 6660
                    , 6660, 6660, 6660, 6660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 6660, 6660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7020, sellCostBuyPrice =sellCostBuyPrice+6660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6660
                        , returnSellVal = returnSellVal+0, 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+18
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7020, 6660, 6660
                    , 6660, 6660, 6660, 6660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6660, 6660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7020, sellCostBuyPrice =sellCostBuyPrice+6660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6660
                        , returnSellVal = returnSellVal+0, 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 = '18', userid = '2', storedetaildate = '2026-09-30 18:33:45' WHERE storedetailid = '1215';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1215', '1', '18', '1', '24', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '18', '2', '2026-09-30 18:33:45','0','0'); -- id=1592
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+43 where id = 46;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','09745', '24', '71', '1247', '56', '200', '11200', '0', '', '0', '2026-09-30 18:33:45', '1247', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','46-43,','1','1','0','0','200','11200','0','','0','0.00','0','0','0','0'); -- id=124
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 188.64, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 188.64
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 188.64, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 124;
 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 (1247, '2026-09-30', 11200, 10640, 10640
                    , 10563.84, 10640, 10563.84, 10640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 56, 0, 10640, 10563.84, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11200, sellCostBuyPrice =sellCostBuyPrice+10640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10563.84
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10563.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10563.84
                        , returnSellVal = returnSellVal+0, 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+56
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 11200, 10640, 10640
                    , 10563.84, 10640, 10563.84, 10640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10640, 10563.84, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11200, sellCostBuyPrice =sellCostBuyPrice+10640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10563.84
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10563.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10563.84
                        , returnSellVal = returnSellVal+0, 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 = '66', userid = '2', storedetaildate = '2026-09-30 18:33:45' WHERE storedetailid = '1247';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1247', '1', '56', '1', '24', 'اضافة فاتورة مبيعات', 'sellbillController.php', '122', '66', '2', '2026-09-30 18:33:45','0','0'); -- id=1593
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '190730',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('160470','30260', '0', '2', 'اضافة فاتورة مبيعات', '24', '190730', '2026-09-30 18:33:45', '2',  'sellbillController.php','1','','0'); -- id=37
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30260', '30260', '2026-09-30', '2', '0', '0', '2026-09-30 18:33:45','اضافة فاتورة مبيعات رقم 24','1','0',null,'0','24','sellbillController.php?do=showDetail&sellbillid=24'); -- id=847
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('847', '419', '30260', '','0'); -- id=848
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '190730', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('847', '143', '30260', '','0'); -- id=847
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '353750', 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 ( '28610', '28610', '2026-09-30', '2', '0', '0', '2026-09-30 18:33:45','اضافة فاتورة مبيعات رقم 24 - صرف البضاعة من المخزن','1','0',null,'0','24','sellbillController.php?do=showDetail&sellbillid=24'); -- id=848
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('848', '402', '28610', '','0'); -- id=849
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '344879.35', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('848', '382', '28610', '','0'); -- id=848
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12654405.65', 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='847,0,848' where sellbillid=24;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 30260, 28610, 28610
                    , 28488.96, 28610, 28488.96, 28610
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,28610, 28488.96, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30260, sellCostBuyPrice =sellCostBuyPrice+28610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+28610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+28488.96
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+28610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+28488.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+28610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+28610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28488.96
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 30260, 28610, 28610
                    , 28488.96, 28610, 28488.96, 28610
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,28610, 28488.96, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30260, sellCostBuyPrice =sellCostBuyPrice+28610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+28610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+28488.96
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+28610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+28488.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+28610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+28610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28488.96
                        , returnSellVal = returnSellVal+0, 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, 30260, 28610, 28610
                    , 28488.96, 28610, 28488.96, 28610, 28610, 28488.96)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+30260, netSellCostBuyPrice = netSellCostBuyPrice+28610
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+28610
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+28488.96
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+28610
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+28488.96
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+28610
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+28610
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+28488.96;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abd28ca5a6b5 and sellbillId = 24 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 15:03:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:33:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 18:33:46', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1348
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 15:28:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:58:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 18:58:38', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=1349
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 15:29:01";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:59:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 18:59:01', '1', 'add2', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=1350
INSERT INTO productcat (productCatName, productCatDate, productCatDescription, productCatParent, userId, conditions, selldiscount, buydiscount, discounttype,isOptic , buytotal , buyhalf , buypart ,buypricereal,opticServices,logo,inMenu,stopNegativeSale,catExcelid,webApiId,obygyInvestigationCatId,price4,price5,price6,price7,price8,price9,price10,price11,price12,price13) VALUES ('محمد نادر تريكو','2026-09-30','','85', '1','0', '0', '0', '-1', '0', '0', '0', '0','0','','.','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); -- id=89
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (89, 1,'2026-09-30 18:59:01',1)
                ON DUPLICATE KEY UPDATE catid = 89, edited = 1, sysdate = '2026-09-30 18:59:01', userid = 1; -- id=89
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '89', '1', '2026-09-30', '1', '0'); -- id=5
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 15:29:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:59:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 18:59:02', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=1351
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 15:29:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:59:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-09-30 18:59:03', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=1352
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 15:29:10";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 18:59:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 18:59:10', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1353
UPDATE user SET loginip = "" WHERE userid = 2;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 15:36:30";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:06:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 19:06:30', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=1354
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('فيندي حوض محمد تريكو','','89','370','410','410','410','2026-09-30','0','1','0','','0','0','0','0','0','370','370','370','370','370','0','10.81','0','0','.','0','0','0','370','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','370','370','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','370','0','0','0','0','0','0','','','0','0','0','0'); -- id=1361
UPDATE product SET productName = 'فيندي حوض محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '370', productSellAllPrice = '410', productSellUnitPrice = '410', productSellHalfPrice = '410', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01361',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '370',meanbuyprice = '370',meanbuyprice_withDiscount = '370' , productbuypricereal = '370' , buypricereal_precentage = '0' , buytotal_precentage = '10.81' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='370',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='370',meanbuyprice_withTax='370',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='370',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1361';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1361', '1.00', '2026-09-30', '1', '0','0136101','410','410','410','370','','0','0','0','0','0','0','0','0','0','0'); -- id=1361
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1361', '1', '0', '1', '2026-09-30'); -- id=1361
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1361', '1', '0', '0', '1361', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1594
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1361, 1,'2026-09-30 19:06:30',1)
                ON DUPLICATE KEY UPDATE productid = 1361, edited = 1, sysdate = '2026-09-30 19:06:30', userid = 1; -- id=2036
UPDATE product SET productName = 'فيندي حوض محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '370.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01361',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '370',meanbuyprice = '370',meanbuyprice_withDiscount = '370' , productbuypricereal = '370' , buypricereal_precentage = '0' , buytotal_precentage = '10.81' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='370',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='370',meanbuyprice_withTax='370',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='370',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1361';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('برادا حوض محمد تريكو','','89','370','410','410','410','2026-09-30','0','1','0','','0','0','0','0','0','370','370','370','370','370','0','10.81','0','0','.','0','0','0','370','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','370','370','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','370','0','0','0','0','0','0','','','0','0','0','0'); -- id=1362
UPDATE product SET productName = 'برادا حوض محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '370', productSellAllPrice = '410', productSellUnitPrice = '410', productSellHalfPrice = '410', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01362',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '370',meanbuyprice = '370',meanbuyprice_withDiscount = '370' , productbuypricereal = '370' , buypricereal_precentage = '0' , buytotal_precentage = '10.81' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='370',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='370',meanbuyprice_withTax='370',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='370',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1362';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1362', '1.00', '2026-09-30', '1', '0','0136201','410','410','410','370','','0','0','0','0','0','0','0','0','0','0'); -- id=1362
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1362', '1', '0', '1', '2026-09-30'); -- id=1362
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1362', '1', '0', '0', '1362', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1595
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1362, 1,'2026-09-30 19:06:30',1)
                ON DUPLICATE KEY UPDATE productid = 1362, edited = 1, sysdate = '2026-09-30 19:06:30', userid = 1; -- id=2037
UPDATE product SET productName = 'برادا حوض محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '370.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01362',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '370',meanbuyprice = '370',meanbuyprice_withDiscount = '370' , productbuypricereal = '370' , buypricereal_precentage = '0' , buytotal_precentage = '10.81' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='370',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='370',meanbuyprice_withTax='370',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='370',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1362';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('شعيرات حوض محمد تريكو','','89','390','430','430','430','2026-09-30','0','1','0','','0','0','0','0','0','390','390','390','390','390','0','10.26','0','0','.','0','0','0','390','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','390','390','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','390','0','0','0','0','0','0','','','0','0','0','0'); -- id=1363
UPDATE product SET productName = 'شعيرات حوض محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '390', productSellAllPrice = '430', productSellUnitPrice = '430', productSellHalfPrice = '430', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01363',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390',lastbuyprice_withDiscount = '390',meanbuyprice = '390',meanbuyprice_withDiscount = '390' , productbuypricereal = '390' , buypricereal_precentage = '0' , buytotal_precentage = '10.26' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1363';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1363', '1.00', '2026-09-30', '1', '0','0136301','430','430','430','390','','0','0','0','0','0','0','0','0','0','0'); -- id=1363
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1363', '1', '0', '1', '2026-09-30'); -- id=1363
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1363', '1', '0', '0', '1363', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1596
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1363, 1,'2026-09-30 19:06:30',1)
                ON DUPLICATE KEY UPDATE productid = 1363, edited = 1, sysdate = '2026-09-30 19:06:30', userid = 1; -- id=2038
UPDATE product SET productName = 'شعيرات حوض محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '390.00', productSellAllPrice = '430.00', productSellUnitPrice = '430.00', productSellHalfPrice = '430.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01363',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390',lastbuyprice_withDiscount = '390',meanbuyprice = '390',meanbuyprice_withDiscount = '390' , productbuypricereal = '390' , buypricereal_precentage = '0' , buytotal_precentage = '10.26' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1363';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('ديفرة نص سوسته محمد تريكو','','89','380','420','420','420','2026-09-30','0','1','0','','0','0','0','0','0','380','380','380','380','380','0','10.53','0','0','.','0','0','0','380','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','380','380','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','380','0','0','0','0','0','0','','','0','0','0','0'); -- id=1364
UPDATE product SET productName = 'ديفرة نص سوسته محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '380', productSellAllPrice = '420', productSellUnitPrice = '420', productSellHalfPrice = '420', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01364',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380' , buypricereal_precentage = '0' , buytotal_precentage = '10.53' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='380',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1364';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1364', '1.00', '2026-09-30', '1', '0','0136401','420','420','420','380','','0','0','0','0','0','0','0','0','0','0'); -- id=1364
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1364', '1', '0', '1', '2026-09-30'); -- id=1364
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1364', '1', '0', '0', '1364', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1597
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1364, 1,'2026-09-30 19:06:30',1)
                ON DUPLICATE KEY UPDATE productid = 1364, edited = 1, sysdate = '2026-09-30 19:06:30', userid = 1; -- id=2039
UPDATE product SET productName = 'ديفرة نص سوسته محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '380.00', productSellAllPrice = '420.00', productSellUnitPrice = '420.00', productSellHalfPrice = '420.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01364',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380' , buypricereal_precentage = '0' , buytotal_precentage = '10.53' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='380',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1364';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('هاند ميد زراير محمد تريكو','','89','380','420','420','420','2026-09-30','0','1','0','','0','0','0','0','0','380','380','380','380','380','0','10.53','0','0','.','0','0','0','380','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','380','380','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','380','0','0','0','0','0','0','','','0','0','0','0'); -- id=1365
UPDATE product SET productName = 'هاند ميد زراير محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '380', productSellAllPrice = '420', productSellUnitPrice = '420', productSellHalfPrice = '420', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01365',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380' , buypricereal_precentage = '0' , buytotal_precentage = '10.53' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='380',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1365';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '1365', '1.00', '2026-09-30', '1', '0','0136501','420','420','420','380','','0','0','0','0','0','0','0','0','0','0'); -- id=1365
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1365', '1', '0', '1', '2026-09-30'); -- id=1365
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1365', '1', '0', '0', '1365', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-09-30','0','0'); -- id=1598
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1365, 1,'2026-09-30 19:06:30',1)
                ON DUPLICATE KEY UPDATE productid = 1365, edited = 1, sysdate = '2026-09-30 19:06:30', userid = 1; -- id=2040
UPDATE product SET productName = 'هاند ميد زراير محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '380.00', productSellAllPrice = '420.00', productSellUnitPrice = '420.00', productSellHalfPrice = '420.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01365',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380' , buypricereal_precentage = '0' , buytotal_precentage = '10.53' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='380',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1365';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 15:36:31";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:06:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 19:06:31', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=1355
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 15:36:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:06:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 19:06:33', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1356
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 15:39:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:09:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 19:09:17', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1357
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 15:45:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:15:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 19:15:39', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1358
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 15:45:40";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 19:15:40', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1359
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:03:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:33:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 19:33:57', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1360
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:03:57";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 19:33:57', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1361
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:04:06";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:34:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 19:34:06', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1362
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:14:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:44:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 19:44:08', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1363
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:15:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:45:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 19:45:09', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1364
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:15:09";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 19:45:09', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1365
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:15:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:45:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 19:45:13', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1366
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:20:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:50:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 19:50:00', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1367
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:20:01";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 19:50:01', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1368
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:20:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:50:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 19:50:04', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1369
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:28:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:58:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 19:58:09', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1370
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:28:09";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 19:58:09', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1371
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:28:41";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:58:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 19:58:41', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1372
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:29:54";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 19:59:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 19:59:54', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1373
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:29:55";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 19:59:55', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1374
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:31:07";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:31:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:01:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 20:01:09', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1375
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:31:10";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 20:01:10', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1376
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:31:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:01:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 20:01:16', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1377
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:31:52";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:01:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 20:01:52', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1378
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:31:52";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 20:01:52', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1379
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:31:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:01:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 20:01:56', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1380
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:33:31";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:03:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 20:03:31', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1381
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:37:04";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:37:18";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:39:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:09:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 20:09:38', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1382
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:39:38";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 20:09:38', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1383
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 < "2026-09-30 16:40:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:10:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 20:10:07', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1384
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:40:08";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 20:10:08', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1385
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:40:12";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:10:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 20:10:12', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1386
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:43:01";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:13:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 20:13:01', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1387
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:43:08";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:43:12";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:13:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 20:13:12', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1388
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:43:12";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-09-30 20:13:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 20:13:12', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1389
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:43:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:13:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:13:17', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1390
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:58:36";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:58:36";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:58:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:28:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 20:28:38', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1391
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:58:39";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 20:28:39', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1392
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:58:44";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:28:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:28:44', '1', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1393
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:58:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:28:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:28:46', '1', 'showDetail', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=24'); -- id=1394
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 16:59:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:29:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreportbills.php', '2026-09-30 20:29:08', '1', 'showbills', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreportbills.php?do=showbills'); -- id=1395
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:00:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:30:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:30:04', '1', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1396
INSERT INTO client (clientname, clientaddress, clientphone, clientmobile, clientdebt, clientdetails, conditions, clientdate, userid,clientareaid,clientcode,dailyentryid ,rondomtxt,clientStoreIds,obygyPatientId,debtLimit,typeclientid,priceTypeId,card_number,file_faida,specialDiscount,specialDiscountVal,file,addDate,mandobCollectRatio,webApiId,clientRFID,linkedSupplierId,postponeDays,studentid,taxnumber,password,clientTypeForTree,treeId,husbandNameObgy,txtNameE,facility,delegate,txtemail,commercial,valtaxnumber,clientaddress2,country,delegateid,datecustomeraccount,taxfile,fileimg,webStoreType,clientaddress3,tagids,email_verified,email_otp,email_otp_expiry) VALUES ('مؤمن ارينا' , '', '', '', '0', '', '0', '2026-09-30 20:31:33', '1', '0','','0','','-10','0','10000',',','-1','0','.','0','0','.','2026-09-30','0','0','','0','0','0','','','0','0','','','','','','','','','','-1','','','','0','','','0','0',''); -- id=7
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('7', '0', '0', '', ''); -- id=6
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 ('7','0','0','0','إضافة عميل جديد','7', '0', '2026-09-30 20:31:33', '1', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1','','0','0','',''); -- id=40
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مؤمن ارينا', 'مؤمن ارينا', 'مؤمن ارينا', 'مؤمن ارينا', '58', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '1', '0', '2026-09-30 20:31:33'); -- id=500
UPDATE client SET clientname = 'مؤمن ارينا', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2026-09-30', userid = '1'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='10000' , typeclientid=',',priceTypeId='-1',lastEditUser = '0',card_number = '0',file_faida = '.',specialDiscount = '0',specialDiscountVal = '0',file = '.',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '0',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='500',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='-1',datecustomeraccount='0000-00-00',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='0000-00-00 00:00:00' WHERE clientid = '7';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:01:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:31:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:31:42', '1', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=1397

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abd471cd76e7
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(7,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 20:31:42', '06abd471cd76e7', '7', '0.00', '26800', '0', '1', '26800.00', '26800', '0', '26800', '1', '2026-09-30 20:31:42', '', '1', '0', 'مؤمن ارينا', '1', '1', '3', '0', 'مؤمن ارينا', '40' ,'0','','','','','-1','0','0','0','0','0','26800','0','','0','0','0','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-09-30','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=25
UPDATE client SET  clientdebt = '26800', userid = '1' WHERE clientid = '7';
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 ('7','0.00','26800','0','اضافة فاتورة مبيعات','25', '26800', '2026-09-30 20:31:42', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '26800', '0', null, '0', null, null,'', '0','1','1','26800','1','2026-09-30 20:31:42','0','0','',''); -- id=41
UPDATE client SET  inUse = 0 where clientid = 7;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 22;
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 ('750','01342', '25', '28', '1342', '5', '770', '3850', '0', '', '0', '2026-09-30 20:31:42', '1342', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','22-5,','1','1','0','0','770','3850','0','','0','0.00','0','0','0','0'); -- id=125
UPDATE sellbilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 750.00, meanbuyprice_withDiscount = 750.00
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 750, lastbuyprice_withDiscountAndTax = 750
                where sellbilldetailid = 125;
 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 (1342, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:31:42' WHERE storedetailid = '1342';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1342', '1', '5', '1', '25', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '1', '2026-09-30 20:31:42','0','0'); -- id=1599
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 21;
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 ('625','01341', '25', '28', '1341', '5', '645', '3225', '0', '', '0', '2026-09-30 20:31:42', '1341', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','21-5,','1','1','0','0','645','3225','0','','0','0.00','0','0','0','0'); -- id=126
UPDATE sellbilldetail SET  lastbuyprice = 625.00 , meanbuyprice = 625.00, lastbuyprice_withDiscount = 625.00, meanbuyprice_withDiscount = 625.00
        , lastbuyprice_withTax = 625, meanbuyprice_withTax = 625, lastbuyprice_withDiscountAndTax = 625
                where sellbilldetailid = 126;
 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 (1341, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 20:31:42' WHERE storedetailid = '1341';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1341', '1', '5', '1', '25', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '1', '2026-09-30 20:31:42','0','0'); -- id=1600
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 18;
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 ('700','01338', '25', '28', '1338', '5', '720', '3600', '0', '', '0', '2026-09-30 20:31:42', '1338', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','18-5,','1','1','0','0','720','3600','0','','0','0.00','0','0','0','0'); -- id=127
UPDATE sellbilldetail SET  lastbuyprice = 700.00 , meanbuyprice = 700.00, lastbuyprice_withDiscount = 700.00, meanbuyprice_withDiscount = 700.00
        , lastbuyprice_withTax = 700, meanbuyprice_withTax = 700, lastbuyprice_withDiscountAndTax = 700
                where sellbilldetailid = 127;
 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 (1338, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 20:31:42' WHERE storedetailid = '1338';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1338', '1', '5', '1', '25', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '1', '2026-09-30 20:31:42','0','0'); -- id=1601
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where 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 ('646.16','01337', '25', '8', '1337', '5', '685', '3425', '0', '', '0', '2026-09-30 20:31:42', '1337', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','31-5,','1','1','0','0','685','3425','0','','0','0.00','0','0','0','0'); -- id=128
UPDATE sellbilldetail SET  lastbuyprice = 655.00 , meanbuyprice = 655.00, lastbuyprice_withDiscount = 646.16, meanbuyprice_withDiscount = 646.16
        , lastbuyprice_withTax = 655, meanbuyprice_withTax = 655, lastbuyprice_withDiscountAndTax = 646.16
                where sellbilldetailid = 128;
 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 (1337, '2026-09-30', 3425, 3275, 3275
                    , 3275, 3230.8, 3230.8, 3230.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3275, 3275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3425, sellCostBuyPrice =sellCostBuyPrice+3275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3230.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3230.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3230.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3275
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3425, 3275, 3275
                    , 3275, 3230.8, 3230.8, 3230.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3275, 3275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3425, sellCostBuyPrice =sellCostBuyPrice+3275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3230.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3230.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3230.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3275
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 20:31:42' WHERE storedetailid = '1337';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1337', '1', '5', '1', '25', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '20', '1', '2026-09-30 20:31:42','0','0'); -- id=1602
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 26;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('641.23','01332', '25', '8', '1332', '5', '670', '3350', '0', '', '0', '2026-09-30 20:31:42', '1332', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','26-5,','1','1','0','0','670','3350','0','','0','0.00','0','0','0','0'); -- id=129
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 641.23, meanbuyprice_withDiscount = 641.23
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 650, lastbuyprice_withDiscountAndTax = 641.23
                where sellbilldetailid = 129;
 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 (1332, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3350, sellCostBuyPrice =sellCostBuyPrice+3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3350, sellCostBuyPrice =sellCostBuyPrice+3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 20:31:42' WHERE storedetailid = '1332';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1332', '1', '5', '1', '25', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '1', '2026-09-30 20:31:42','0','0'); -- id=1603
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 23;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','01343', '25', '28', '1343', '5', '690', '3450', '0', '', '0', '2026-09-30 20:31:42', '1343', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','23-5,','1','1','0','0','690','3450','0','','0','0.00','0','0','0','0'); -- id=130
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 130;
 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 (1343, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3450, sellCostBuyPrice =sellCostBuyPrice+3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3450, sellCostBuyPrice =sellCostBuyPrice+3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 20:31:42' WHERE storedetailid = '1343';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1343', '1', '5', '1', '25', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '1', '2026-09-30 20:31:42','0','0'); -- id=1604
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 27;
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 ('503.12','01333', '25', '8', '1333', '5', '530', '2650', '0', '', '0', '2026-09-30 20:31:42', '1333', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','27-5,','1','1','0','0','530','2650','0','','0','0.00','0','0','0','0'); -- id=131
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 503.12, meanbuyprice_withDiscount = 503.12
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 503.12
                where sellbilldetailid = 131;
 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 (1333, '2026-09-30', 2650, 2550, 2550
                    , 2550, 2515.6, 2515.6, 2515.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2550, 2550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2650, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2515.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2515.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2515.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2650, 2550, 2550
                    , 2550, 2515.6, 2515.6, 2515.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2550, 2550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2650, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2515.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2515.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2515.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 20:31:42' WHERE storedetailid = '1333';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1333', '1', '5', '1', '25', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '1', '2026-09-30 20:31:42','0','0'); -- id=1605
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 20;
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 ('630','01340', '25', '28', '1340', '5', '650', '3250', '0', '', '0', '2026-09-30 20:31:42', '1340', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','20-5,','1','1','0','0','650','3250','0','','0','0.00','0','0','0','0'); -- id=132
UPDATE sellbilldetail SET  lastbuyprice = 630.00 , meanbuyprice = 630.00, lastbuyprice_withDiscount = 630.00, meanbuyprice_withDiscount = 630.00
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 630, lastbuyprice_withDiscountAndTax = 630
                where sellbilldetailid = 132;
 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 (1340, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 20:31:42' WHERE storedetailid = '1340';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1340', '1', '5', '1', '25', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '1', '2026-09-30 20:31:42','0','0'); -- id=1606
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '26800', '26800', '2026-09-30', '1', '0', '0', '2026-09-30 20:31:42','اضافة فاتورة مبيعات رقم 25','1','0',null,'0','25','sellbillController.php?do=showDetail&sellbillid=25'); -- id=849
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('849', '500', '26800', '','0'); -- id=850
UPDATE accountstree SET name = 'مؤمن ارينا', customName = 'مؤمن ارينا', customNameEn = 'مؤمن ارينا', nameEn = 'مؤمن ارينا', parent = '58', accountNature = '0', theValue = '26800', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 20:31:33' WHERE id = '500';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('849', '143', '26800', '','0'); -- id=849
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '380550', 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 ( '25827.55', '25827.55', '2026-09-30', '1', '0', '0', '2026-09-30 20:31:42','اضافة فاتورة مبيعات رقم 25 - صرف البضاعة من المخزن','1','0',null,'0','25','sellbillController.php?do=showDetail&sellbillid=25'); -- id=850
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('850', '402', '25827.55', '','0'); -- id=851
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '370706.9', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('850', '382', '25827.55', '','0'); -- id=850
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12628578.1', 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='849,0,850' where sellbillid=25;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 26800, 25950, 25950
                    , 25950, 25827.55, 25827.55, 25827.55
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,25950, 25950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+26800, sellCostBuyPrice =sellCostBuyPrice+25950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+25950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+25950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+25827.55, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+25827.55
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+25827.55
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+25950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+25950
                        , returnSellVal = returnSellVal+0, 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 (7, '2026-09-30', 26800, 25950, 25950
                    , 25950, 25827.55, 25827.55, 25827.55
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,25950, 25950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+26800, sellCostBuyPrice =sellCostBuyPrice+25950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+25950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+25950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+25827.55, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+25827.55
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+25827.55
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+25950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+25950
                        , returnSellVal = returnSellVal+0, 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, 26800, 25950, 25950
                    , 25950, 25827.55, 25827.55, 25827.55, 25950, 25950)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+26800, netSellCostBuyPrice = netSellCostBuyPrice+25950
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+25950
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+25950
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+25827.55
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+25827.55
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+25827.55
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+25950
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+25950;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abd471cd76e7 and sellbillId = 25 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:01:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:31:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:31:42', '1', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=1398
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:05:52";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:35:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-09-30 20:35:52', '1', 'sellandreturnreport', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellBillReportsController.php?do=sellandreturnreport'); -- id=1399
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:07:10";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:37:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-09-30 20:37:10', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=1400
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:07:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:37:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-09-30 20:37:16', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=1401
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:07:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:37:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:37:36', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1402
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:07:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:37:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:37:39', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1403
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:08:06";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:38:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillandruternController.php', '2026-09-30 20:38:06', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillandruternController.php?do=show'); -- id=1404
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:08:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:38:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillandruternController.php', '2026-09-30 20:38:11', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillandruternController.php?do=show'); -- id=1405
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:08:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:38:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:38:33', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=show'); -- id=1406
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:08:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:38:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:38:48', '1', 'edit', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=edit&id=4'); -- id=1407
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:08:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:38:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-09-30 20:38:56', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=1408
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:09:05";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:39:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:39:05', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=update'); -- id=1409
UPDATE tamweenclientdetail SET clientid = '4', noOfPersonsTamween = '0', noOfPersonsDa3m = '0', cardNum = '', cardPassword = '' WHERE id = '3';
UPDATE accountstree SET name = 'محل الفيوم vip', customName = 'محل الفيوم vip', customNameEn = 'VIP', nameEn = 'VIP', parent = '58', accountNature = '0', theValue = '0.00', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 20:39:05' WHERE id = '496';
UPDATE client SET clientname = 'محل الفيوم vip', clientaddress = '', clientphone = '', clientmobile = '', clientdetails = '', conditions = '0', clientdate = '2026-09-30 20:39:05', userid = '2'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , debtLimit='0' , 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='496',clientaddress2='',country='',delegateid='-1',webStoreType='0',clientaddress3='',taxfile='',fileimg='',tagids='0',txtemail='' WHERE clientid = '4';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:09:05";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:39:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:39:05', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=sucess'); -- id=1410
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:09:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:39:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:39:07', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=show'); -- id=1411
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:09:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:39:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:39:18', '1', 'tempdelete', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=tempdelete&id=5'); -- id=1412
UPDATE client SET conditions = 1
		        WHERE clientid =5 ;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:09:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:39:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:39:18', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=sucess'); -- id=1413
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:09:19";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:39:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:39:19', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=show'); -- id=1414
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:09:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:39:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:39:28', '1', 'edit', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=edit&id=6'); -- id=1415
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:09:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:39:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:39:57', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=update'); -- id=1416
UPDATE tamweenclientdetail SET clientid = '6', noOfPersonsTamween = '0', noOfPersonsDa3m = '0', cardNum = '', cardPassword = '' WHERE id = '5';
UPDATE accountstree SET name = 'محل الشاذلي بني سويف', customName = 'محل الشاذلي بني سويف', customNameEn = 'بني سويف', nameEn = 'بني سويف', parent = '58', accountNature = '0', theValue = '0.00', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 20:39:57' WHERE id = '498';
UPDATE client SET clientname = 'محل الشاذلي بني سويف', clientaddress = '', clientphone = '01090856430', clientmobile = '', clientdetails = '', conditions = '0', clientdate = '2026-09-30 20:39:57', userid = '2'  , clientareaid = '0'  ,clientcode = '',dailyentryid = '0' , rondomtxt = '',clientStoreIds = '-10', obygyPatientId = '0' , 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='498',clientaddress2='',country='',delegateid='-1',webStoreType='0',clientaddress3='',taxfile='',fileimg='',tagids='0',txtemail='' WHERE clientid = '6';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:09:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:39:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:39:57', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=sucess'); -- id=1417
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:09:58";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:39:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:39:58', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=show'); -- id=1418
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:10:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:40:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:40:11', '1', 'deleteFinaly', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=deleteFinaly&id=2&action=0'); -- id=1419
UPDATE accountstree SET name = 'احمد العربي', customName = 'احمد العربي', customNameEn = 'احمد العربي', nameEn = 'احمد العربي', parent = '58', accountNature = '0', theValue = '0.00', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '1', sysdate = '2026-09-28 08:25:29' WHERE id = '420';
DELETE FROM tamweenclientdetail WHERE clientid = '2';
DELETE FROM client WHERE clientid = '2';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:10:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:40:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:40:11', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=sucess'); -- id=1420
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:10:12";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:40:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-09-30 20:40:12', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=show'); -- id=1421
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:10:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:40:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-09-30 20:40:23', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=1422
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:11:22";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:41:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillandruternController.php', '2026-09-30 20:41:22', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillandruternController.php?do=show'); -- id=1423
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:11:25";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:41:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillandruternController.php', '2026-09-30 20:41:25', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillandruternController.php?do=show'); -- id=1424
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:11:27";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:41:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillandruternController.php', '2026-09-30 20:41:27', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillandruternController.php?do=show'); -- id=1425
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:11:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:41:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillandruternController.php', '2026-09-30 20:41:38', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillandruternController.php?do=show'); -- id=1426
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:11:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:41:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-30 20:41:48', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientdebt.php'); -- id=1427
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:11:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:41:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-09-30 20:41:48', '1', 'showallajax', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientdebt.php?do=showallajax'); -- id=1428
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:11:59";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:41:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-09-30 20:41:59', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=1429
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:12:01";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:42:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-09-30 20:42:01', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=1430
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:12:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:42:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('billsettingsController.php', '2026-09-30 20:42:21', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/billsettingsController.php?do=show'); -- id=1431
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:12:30";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:42:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-09-30 20:42:30', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellBillReportsController.php'); -- id=1432
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:12:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:42:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-09-30 20:42:48', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=1433
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:13:05";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:43:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-09-30 20:43:05', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellBillReportsController.php?do=show'); -- id=1434
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:13:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:43:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:43:11', '1', 'showDetail', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=17'); -- id=1435
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:13:34";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:43:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:43:34', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1436
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:13:37";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:43:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:43:37', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1437
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:13:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:43:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:43:39', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1438
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:14:15";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:44:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-09-30 20:44:15', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=1439
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:14:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:44:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:44:45', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1440
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:14:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:44:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:44:50', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1441
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:14:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:44:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:44:56', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1442
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:15:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:45:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:45:08', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1443
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:17:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:47:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:47:07', '1', 'editsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=20'); -- id=1444
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:17:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:47:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:47:18', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=update'); -- id=1445
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 20;
UPDATE sellbill SET  sellbillsysdate = '2026-09-30 20:47:18', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '20';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-20 where id = 7;
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 83;
 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 (833, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8600
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-20
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8600
                        , returnSellVal = returnSellVal-0, 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 = '64', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '833';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('833', '1', '20', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '44', '64', '1', '2026-09-30 15:48:30','0','0'); -- id=1607
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 6;
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 84;
 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 (1322, '2026-09-30', 3850, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 3600, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3850, sellCostBuyPrice =sellCostBuyPrice-3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1800
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-10
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3850, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3850, sellCostBuyPrice =sellCostBuyPrice-3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1800
                        , returnSellVal = returnSellVal-0, 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 = '45', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1322';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1322', '1', '10', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '35', '45', '1', '2026-09-30 15:48:30','0','0'); -- id=1608
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 28;
UPDATE sellbilldetail SET  lastbuyprice = 565.00 , meanbuyprice = 565.00, lastbuyprice_withDiscount = 557.37, meanbuyprice_withDiscount = 557.37
        , lastbuyprice_withTax = 565, meanbuyprice_withTax = 565, lastbuyprice_withDiscountAndTax = 557.37
                where sellbilldetailid = 85;
 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 (1334, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5850, sellCostBuyPrice =sellCostBuyPrice-5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-10
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5850, sellCostBuyPrice =sellCostBuyPrice-5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1334';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1334', '1', '10', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '10', '1', '2026-09-30 15:48:30','0','0'); -- id=1609
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 21;
UPDATE sellbilldetail SET  lastbuyprice = 625.00 , meanbuyprice = 625.00, lastbuyprice_withDiscount = 625.00, meanbuyprice_withDiscount = 625.00
        , lastbuyprice_withTax = 625, meanbuyprice_withTax = 625, lastbuyprice_withDiscountAndTax = 625
                where sellbilldetailid = 86;
 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 (1341, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3225, sellCostBuyPrice =sellCostBuyPrice-3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3125
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3225, sellCostBuyPrice =sellCostBuyPrice-3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3125
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1341';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1341', '1', '5', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '10', '1', '2026-09-30 15:48:30','0','0'); -- id=1610
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-20 where id = 19;
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 87;
 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 (1339, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8600
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-20
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8600
                        , returnSellVal = returnSellVal-0, 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 = '25', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1339';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1339', '1', '20', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '25', '1', '2026-09-30 15:48:30','0','0'); -- id=1611
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 24;
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 510
                where sellbilldetailid = 88;
 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 (945, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7950, sellCostBuyPrice =sellCostBuyPrice-7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7950, sellCostBuyPrice =sellCostBuyPrice-7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7650
                        , returnSellVal = returnSellVal-0, 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 = '35', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '945';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('945', '1', '15', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '20', '35', '1', '2026-09-30 15:48:30','0','0'); -- id=1612
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 20;
UPDATE sellbilldetail SET  lastbuyprice = 630.00 , meanbuyprice = 630.00, lastbuyprice_withDiscount = 630.00, meanbuyprice_withDiscount = 630.00
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 630, lastbuyprice_withDiscountAndTax = 630
                where sellbilldetailid = 89;
 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 (1340, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3250, sellCostBuyPrice =sellCostBuyPrice-3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3150
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3250, sellCostBuyPrice =sellCostBuyPrice-3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3150
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1340';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1340', '1', '5', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '10', '1', '2026-09-30 15:48:30','0','0'); -- id=1613
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 18;
UPDATE sellbilldetail SET  lastbuyprice = 700.00 , meanbuyprice = 700.00, lastbuyprice_withDiscount = 700.00, meanbuyprice_withDiscount = 700.00
        , lastbuyprice_withTax = 700, meanbuyprice_withTax = 700, lastbuyprice_withDiscountAndTax = 700
                where sellbilldetailid = 90;
 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 (1338, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3600, sellCostBuyPrice =sellCostBuyPrice-3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3500
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3600, sellCostBuyPrice =sellCostBuyPrice-3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3500
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1338';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1338', '1', '5', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '10', '1', '2026-09-30 15:48:30','0','0'); -- id=1614
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 36;
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 485.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 485.00
        , lastbuyprice_withTax = 485, meanbuyprice_withTax = 485, lastbuyprice_withDiscountAndTax = 485
                where sellbilldetailid = 91;
 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 (1344, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7575, sellCostBuyPrice =sellCostBuyPrice-7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7275
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7575, sellCostBuyPrice =sellCostBuyPrice-7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7275
                        , returnSellVal = returnSellVal-0, 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 = '40', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1344', '1', '15', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '25', '40', '1', '2026-09-30 15:48:30','0','0'); -- id=1615
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 22;
UPDATE sellbilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 750.00, meanbuyprice_withDiscount = 750.00
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 750, lastbuyprice_withDiscountAndTax = 750
                where sellbilldetailid = 92;
 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 (1342, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3850, sellCostBuyPrice =sellCostBuyPrice-3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3850, sellCostBuyPrice =sellCostBuyPrice-3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1342';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1342', '1', '5', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '5', '1', '2026-09-30 15:48:30','0','0'); -- id=1616
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 26;
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 641.23, meanbuyprice_withDiscount = 641.23
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 650, lastbuyprice_withDiscountAndTax = 641.23
                where sellbilldetailid = 93;
 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 (1332, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3350, sellCostBuyPrice =sellCostBuyPrice-3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3250
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3350, sellCostBuyPrice =sellCostBuyPrice-3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3250
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1332';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1332', '1', '5', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '10', '1', '2026-09-30 15:48:30','0','0'); -- id=1617
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 45;
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where sellbilldetailid = 94;
 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 (1353, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6200, sellCostBuyPrice =sellCostBuyPrice-6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-10
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6200, sellCostBuyPrice =sellCostBuyPrice-6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6000
                        , returnSellVal = returnSellVal-0, 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 = '25', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1353';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1353', '1', '10', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '25', '1', '2026-09-30 15:48:30','0','0'); -- id=1618
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 23;
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 95;
 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 (1343, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3450, sellCostBuyPrice =sellCostBuyPrice-3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3350
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3450, sellCostBuyPrice =sellCostBuyPrice-3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3350
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1343';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1343', '1', '5', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '15', '1', '2026-09-30 15:48:30','0','0'); -- id=1619
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-5 where id = 25;
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 591.90, meanbuyprice_withDiscount = 591.90
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 591.9
                where sellbilldetailid = 96;
 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 (1331, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3100, sellCostBuyPrice =sellCostBuyPrice-3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3100, sellCostBuyPrice =sellCostBuyPrice-3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1331';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1331', '1', '5', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '20', '1', '2026-09-30 15:48:30','0','0'); -- id=1620
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 35;
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 580.00, meanbuyprice_withDiscount = 580.00
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where sellbilldetailid = 97;
 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 (1330, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8700
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8700
                        , returnSellVal = returnSellVal-0, 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 = '80', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1330';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1330', '1', '15', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '65', '80', '1', '2026-09-30 15:48:30','0','0'); -- id=1621
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-18 where id = 44;
UPDATE sellbilldetail SET  lastbuyprice = 615.00 , meanbuyprice = 615.00, lastbuyprice_withDiscount = 615.00, meanbuyprice_withDiscount = 615.00
        , lastbuyprice_withTax = 615, meanbuyprice_withTax = 615, lastbuyprice_withDiscountAndTax = 615
                where sellbilldetailid = 98;
 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 (1352, '2026-09-30', 11430, 11070, 11070
                    , 11070, 11070, 11070, 11070
                    , 0, 0, 0, 0
                    , 0, 0, 0,18,0, 11070, 11070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-11430, sellCostBuyPrice =sellCostBuyPrice-11070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-11070, sellCostMeanBuyPrice = sellCostMeanBuyPrice-11070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-11070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-11070
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-11070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-11070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-11070
                        , returnSellVal = returnSellVal-0, 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-18
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 11430, 11070, 11070
                    , 11070, 11070, 11070, 11070
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11070, 11070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-11430, sellCostBuyPrice =sellCostBuyPrice-11070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-11070, sellCostMeanBuyPrice = sellCostMeanBuyPrice-11070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-11070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-11070
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-11070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-11070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-11070
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1352', '1', '18', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '30', '1', '2026-09-30 15:48:30','0','0'); -- id=1622
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 34;
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 99;
 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 (1329, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5900, sellCostBuyPrice =sellCostBuyPrice-5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5700
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-10
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5900, sellCostBuyPrice =sellCostBuyPrice-5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5700
                        , returnSellVal = returnSellVal-0, 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 = '40', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1329';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1329', '1', '10', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '30', '40', '1', '2026-09-30 15:48:30','0','0'); -- id=1623
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-25 where id = 5;
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        , lastbuyprice_withTax = 375, meanbuyprice_withTax = 187.5, lastbuyprice_withDiscountAndTax = 375
                where sellbilldetailid = 100;
 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 (1321, '2026-09-30', 10000, 9375, 9375
                    , 9375, 9375, 9375, 9375
                    , 0, 0, 0, 0
                    , 0, 0, 0,25,0, 9375, 4687.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-10000, sellCostBuyPrice =sellCostBuyPrice-9375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9375, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9375
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4687.5
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-25
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 10000, 9375, 9375
                    , 9375, 9375, 9375, 9375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9375, 4687.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-10000, sellCostBuyPrice =sellCostBuyPrice-9375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9375, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9375
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4687.5
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '45', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1321';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1321', '1', '25', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '20', '45', '1', '2026-09-30 15:48:30','0','0'); -- id=1624
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-30 where id = 37;
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 101;
 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 (1345, '2026-09-30', 17700, 17100, 17100
                    , 17100, 17100, 17100, 17100
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 17100, 17100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-17700, sellCostBuyPrice =sellCostBuyPrice-17100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-17100, sellCostMeanBuyPrice = sellCostMeanBuyPrice-17100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-17100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-17100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-17100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-17100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-17100
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-30
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 17700, 17100, 17100
                    , 17100, 17100, 17100, 17100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 17100, 17100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-17700, sellCostBuyPrice =sellCostBuyPrice-17100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-17100, sellCostMeanBuyPrice = sellCostMeanBuyPrice-17100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-17100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-17100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-17100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-17100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-17100
                        , returnSellVal = returnSellVal-0, 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 = '48', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1345';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1345', '1', '30', '0', '20', 'تعديل فاتورة مبيعات', 'sellbillController.php', '18', '48', '1', '2026-09-30 15:48:30','0','0'); -- id=1625
CALL clientInUse(5,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '5';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('5','127280.00','127280.00','1','تعديل فاتورة مبيعات','20', '0', '2026-09-30 15:48:30', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '127280', '0', null, '0', null, null,'', '0','1','1','127280','1','2026-09-30 15:48:30','0','0','',''); -- id=42
UPDATE client SET  inUse = 0 where clientid = 5;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 127280, 122445, 122445
                    , 122445, 122284.35, 122284.35, 122284.35
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,122445, 115957.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-127280, sellCostBuyPrice =sellCostBuyPrice-122445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-122445, sellCostMeanBuyPrice = sellCostMeanBuyPrice-122445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-122284.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-122284.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-122284.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-122445
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-115957.5
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (5, '2026-09-30', 127280, 122445, 122445
                    , 122445, 122284.35, 122284.35, 122284.35
                    , 0, 0, 0, 0
                    , 0, 0, 0, 122445, 115957.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-127280, sellCostBuyPrice =sellCostBuyPrice-122445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-122445, sellCostMeanBuyPrice = sellCostMeanBuyPrice-122445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-122284.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-122284.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-122284.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-122445
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-115957.5
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 127280, 122445, 122445
                    , 122445, 122284.35, 122284.35, 122284.35, 122445, 115957.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-127280, netSellCostBuyPrice = netSellCostBuyPrice-122445
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-122445
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-122445
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-122284.35
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-122284.35
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-122284.35
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-122445
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-115957.5;

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


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

COMMIT;
BEGIN;
CALL clientInUse(4,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,shipfrom,shipto,paymethodshipping,whatShippingCost,sellbilltypeclientid,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 15:48:30', '06abcfa7c85075', '4', '0.00', '127280', '0', '1', '127280', '127280', '0', '127280', '1', '2026-09-30 15:48:30', '', '1', '0', 'محل الفيوم vip', '2', '1', '3', '0', 'محل الفيوم vip', '233', '20', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-30','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0',''); -- id=26
UPDATE client SET  clientdebt = '127280', userid = '1' WHERE clientid = '4';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('4','0.00','127280','0','اضافة فاتورة مبيعات (معدله)','26', '127280', '2026-09-30 20:47:18', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '127280', '0', null, '0', null, null,'', '0','1','1','127280','1','2026-09-30 15:48:30','0','0','',''); -- id=43
UPDATE client SET  inUse = 0 where clientid = 4;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 7;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('430','07429', '26', '19', '833', '20.00', '450', '9000', '0', '', '0', '2026-09-30 20:47:18', '833', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','7-20,','1','1','0','0','450','9000','0','','0','0.00','0','0','0','0'); -- id=133
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 133;
 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 (833, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, 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 = '44', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '833';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('833', '1', '20', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '64', '44', '1', '2026-09-30 20:47:18','0','0'); -- id=1626
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 6;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','01322', '26', '39', '1322', '10.00', '385', '3850', '0', '', '0', '2026-09-30 20:47:18', '1322', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6-10,','1','1','0','0','385','3850','0','','0','0.00','0','0','0','0'); -- id=134
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 134;
 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 (1322, '2026-09-30', 3850, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 3600, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3850, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1800
                        , returnSellVal = returnSellVal+0, 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 = '35', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1322';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1322', '1', '10', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '45', '35', '1', '2026-09-30 20:47:18','0','0'); -- id=1627
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 28;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('557.37','01334', '26', '8', '1334', '10.00', '585', '5850', '0', '', '0', '2026-09-30 20:47:18', '1334', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','28-10,','1','1','0','0','585','5850','0','','0','0.00','0','0','0','0'); -- id=135
UPDATE sellbilldetail SET  lastbuyprice = 565.00 , meanbuyprice = 565.00, lastbuyprice_withDiscount = 557.37, meanbuyprice_withDiscount = 557.37
        , lastbuyprice_withTax = 565, meanbuyprice_withTax = 565, lastbuyprice_withDiscountAndTax = 557.37
                where sellbilldetailid = 135;
 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 (1334, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5850, sellCostBuyPrice =sellCostBuyPrice+5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5850, 5650, 5650
                    , 5650, 5573.7, 5573.7, 5573.7
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5650, 5650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5850, sellCostBuyPrice =sellCostBuyPrice+5650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5573.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5573.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5573.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1334';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1334', '1', '10', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '0', '1', '2026-09-30 20:47:18','0','0'); -- id=1628
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 21;
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 ('625','01341', '26', '28', '1341', '5.00', '645', '3225', '0', '', '0', '2026-09-30 20:47:18', '1341', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','21-5,','1','1','0','0','645','3225','0','','0','0.00','0','0','0','0'); -- id=136
UPDATE sellbilldetail SET  lastbuyprice = 625.00 , meanbuyprice = 625.00, lastbuyprice_withDiscount = 625.00, meanbuyprice_withDiscount = 625.00
        , lastbuyprice_withTax = 625, meanbuyprice_withTax = 625, lastbuyprice_withDiscountAndTax = 625
                where sellbilldetailid = 136;
 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 (1341, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3225, 3125, 3125
                    , 3125, 3125, 3125, 3125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3125, 3125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3225, sellCostBuyPrice =sellCostBuyPrice+3125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1341';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1341', '1', '5', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '5', '1', '2026-09-30 20:47:18','0','0'); -- id=1629
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 19;
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 ('430','01339', '26', '28', '1339', '20.00', '450', '9000', '0', '', '0', '2026-09-30 20:47:18', '1339', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','19-20,','1','1','0','0','450','9000','0','','0','0.00','0','0','0','0'); -- id=137
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 137;
 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 (1339, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1339';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1339', '1', '20', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '25', '5', '1', '2026-09-30 20:47:18','0','0'); -- id=1630
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 24;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('510','09724', '26', '28', '945', '15.00', '530', '7950', '0', '', '0', '2026-09-30 20:47:18', '945', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','24-15,','1','1','0','0','530','7950','0','','0','0.00','0','0','0','0'); -- id=138
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 510.00, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 510.00
        , lastbuyprice_withTax = 510, meanbuyprice_withTax = 510, lastbuyprice_withDiscountAndTax = 510
                where sellbilldetailid = 138;
 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 (945, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7950, sellCostBuyPrice =sellCostBuyPrice+7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7950, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7950, sellCostBuyPrice =sellCostBuyPrice+7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '945';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('945', '1', '15', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '35', '20', '1', '2026-09-30 20:47:18','0','0'); -- id=1631
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 20;
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 ('630','01340', '26', '28', '1340', '5.00', '650', '3250', '0', '', '0', '2026-09-30 20:47:18', '1340', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','20-5,','1','1','0','0','650','3250','0','','0','0.00','0','0','0','0'); -- id=139
UPDATE sellbilldetail SET  lastbuyprice = 630.00 , meanbuyprice = 630.00, lastbuyprice_withDiscount = 630.00, meanbuyprice_withDiscount = 630.00
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 630, lastbuyprice_withDiscountAndTax = 630
                where sellbilldetailid = 139;
 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 (1340, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1340';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1340', '1', '5', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '5', '1', '2026-09-30 20:47:18','0','0'); -- id=1632
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 18;
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 ('700','01338', '26', '28', '1338', '5.00', '720', '3600', '0', '', '0', '2026-09-30 20:47:18', '1338', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','18-5,','1','1','0','0','720','3600','0','','0','0.00','0','0','0','0'); -- id=140
UPDATE sellbilldetail SET  lastbuyprice = 700.00 , meanbuyprice = 700.00, lastbuyprice_withDiscount = 700.00, meanbuyprice_withDiscount = 700.00
        , lastbuyprice_withTax = 700, meanbuyprice_withTax = 700, lastbuyprice_withDiscountAndTax = 700
                where sellbilldetailid = 140;
 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 (1338, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3600, 3500, 3500
                    , 3500, 3500, 3500, 3500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3500, 3500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, sellCostBuyPrice =sellCostBuyPrice+3500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1338';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1338', '1', '5', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '5', '1', '2026-09-30 20:47:18','0','0'); -- id=1633
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 36;
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 ('485','01344', '26', '31', '1344', '15.00', '505', '7575', '0', '', '0', '2026-09-30 20:47:18', '1344', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','36-15,','1','1','0','0','505','7575','0','','0','0.00','0','0','0','0'); -- id=141
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 485.00, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 485.00
        , lastbuyprice_withTax = 485, meanbuyprice_withTax = 485, lastbuyprice_withDiscountAndTax = 485
                where sellbilldetailid = 141;
 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 (1344, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7575, sellCostBuyPrice =sellCostBuyPrice+7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7275
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7575, 7275, 7275
                    , 7275, 7275, 7275, 7275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7275, 7275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7575, sellCostBuyPrice =sellCostBuyPrice+7275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7275
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7275
                        , returnSellVal = returnSellVal+0, 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 = '25', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1344';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1344', '1', '15', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '40', '25', '1', '2026-09-30 20:47:18','0','0'); -- id=1634
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 22;
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 ('750','01342', '26', '28', '1342', '5.00', '770', '3850', '0', '', '0', '2026-09-30 20:47:18', '1342', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','22-5,','1','1','0','0','770','3850','0','','0','0.00','0','0','0','0'); -- id=142
UPDATE sellbilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 750.00, meanbuyprice_withDiscount = 750.00
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 750, lastbuyprice_withDiscountAndTax = 750
                where sellbilldetailid = 142;
 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 (1342, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3850, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1342';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1342', '1', '5', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '5', '0', '1', '2026-09-30 20:47:18','0','0'); -- id=1635
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 26;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('641.23','01332', '26', '8', '1332', '5.00', '670', '3350', '0', '', '0', '2026-09-30 20:47:18', '1332', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','26-5,','1','1','0','0','670','3350','0','','0','0.00','0','0','0','0'); -- id=143
UPDATE sellbilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 641.23, meanbuyprice_withDiscount = 641.23
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 650, lastbuyprice_withDiscountAndTax = 641.23
                where sellbilldetailid = 143;
 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 (1332, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3350, sellCostBuyPrice =sellCostBuyPrice+3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3350, 3250, 3250
                    , 3250, 3206.15, 3206.15, 3206.15
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3250, 3250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3350, sellCostBuyPrice =sellCostBuyPrice+3250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3206.15, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3206.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3206.15
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1332';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1332', '1', '5', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '5', '1', '2026-09-30 20:47:18','0','0'); -- id=1636
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 45;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('600','01353', '26', '31', '1353', '10.00', '620', '6200', '0', '', '0', '2026-09-30 20:47:18', '1353', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','45-10,','1','1','0','0','620','6200','0','','0','0.00','0','0','0','0'); -- id=144
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where sellbilldetailid = 144;
 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 (1353, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6200, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6200, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6200, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1353';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1353', '1', '10', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '25', '15', '1', '2026-09-30 20:47:18','0','0'); -- id=1637
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 23;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('670','01343', '26', '28', '1343', '5.00', '690', '3450', '0', '', '0', '2026-09-30 20:47:18', '1343', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','23-5,','1','1','0','0','690','3450','0','','0','0.00','0','0','0','0'); -- id=145
UPDATE sellbilldetail SET  lastbuyprice = 670.00 , meanbuyprice = 670.00, lastbuyprice_withDiscount = 670.00, meanbuyprice_withDiscount = 670.00
        , lastbuyprice_withTax = 670, meanbuyprice_withTax = 670, lastbuyprice_withDiscountAndTax = 670
                where sellbilldetailid = 145;
 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 (1343, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3450, sellCostBuyPrice =sellCostBuyPrice+3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3450, 3350, 3350
                    , 3350, 3350, 3350, 3350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3350, 3350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3450, sellCostBuyPrice =sellCostBuyPrice+3350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1343';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1343', '1', '5', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '10', '1', '2026-09-30 20:47:18','0','0'); -- id=1638
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 25;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('591.9','01331', '26', '8', '1331', '5.00', '620', '3100', '0', '', '0', '2026-09-30 20:47:18', '1331', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','25-5,','1','1','0','0','620','3100','0','','0','0.00','0','0','0','0'); -- id=146
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 591.90, meanbuyprice_withDiscount = 591.90
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 591.9
                where sellbilldetailid = 146;
 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 (1331, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1331';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1331', '1', '5', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '15', '1', '2026-09-30 20:47:18','0','0'); -- id=1639
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 35;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('580','01330', '26', '37', '1330', '15.00', '600', '9000', '0', '', '0', '2026-09-30 20:47:18', '1330', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','35-15,','1','1','0','0','600','9000','0','','0','0.00','0','0','0','0'); -- id=147
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 580.00, meanbuyprice_withDiscount = 580.00
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where sellbilldetailid = 147;
 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 (1330, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8700, 8700
                    , 8700, 8700, 8700, 8700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8700, 8700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '65', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1330';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1330', '1', '15', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '80', '65', '1', '2026-09-30 20:47:18','0','0'); -- id=1640
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+18 where id = 44;
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 ('615','01352', '26', '31', '1352', '18.00', '635', '11430', '0', '', '0', '2026-09-30 20:47:18', '1352', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','44-18,','1','1','0','0','635','11430','0','','0','0.00','0','0','0','0'); -- id=148
UPDATE sellbilldetail SET  lastbuyprice = 615.00 , meanbuyprice = 615.00, lastbuyprice_withDiscount = 615.00, meanbuyprice_withDiscount = 615.00
        , lastbuyprice_withTax = 615, meanbuyprice_withTax = 615, lastbuyprice_withDiscountAndTax = 615
                where sellbilldetailid = 148;
 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 (1352, '2026-09-30', 11430, 11070, 11070
                    , 11070, 11070, 11070, 11070
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 11070, 11070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11430, sellCostBuyPrice =sellCostBuyPrice+11070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11070, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11070
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11070
                        , returnSellVal = returnSellVal+0, 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+18
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 11430, 11070, 11070
                    , 11070, 11070, 11070, 11070
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11070, 11070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11430, sellCostBuyPrice =sellCostBuyPrice+11070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11070, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11070
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11070
                        , returnSellVal = returnSellVal+0, 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 = '2026-09-30 20:47:18' WHERE storedetailid = '1352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1352', '1', '18', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '30', '12', '1', '2026-09-30 20:47:18','0','0'); -- id=1641
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 34;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('570','01329', '26', '37', '1329', '10.00', '590', '5900', '0', '', '0', '2026-09-30 20:47:18', '1329', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','34-10,','1','1','0','0','590','5900','0','','0','0.00','0','0','0','0'); -- id=149
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 149;
 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 (1329, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5900, sellCostBuyPrice =sellCostBuyPrice+5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5900, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5900, sellCostBuyPrice =sellCostBuyPrice+5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1329';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1329', '1', '10', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '40', '30', '1', '2026-09-30 20:47:18','0','0'); -- id=1642
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+25 where id = 5;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','01321', '26', '39', '1321', '25.00', '400', '10000', '0', '', '0', '2026-09-30 20:47:18', '1321', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','5-25,','1','1','0','0','400','10000','0','','0','0.00','0','0','0','0'); -- id=150
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 375.00, meanbuyprice_withDiscount = 375.00
        , lastbuyprice_withTax = 375, meanbuyprice_withTax = 187.5, lastbuyprice_withDiscountAndTax = 375
                where sellbilldetailid = 150;
 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 (1321, '2026-09-30', 10000, 9375, 9375
                    , 9375, 9375, 9375, 9375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 25, 0, 9375, 4687.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10000, sellCostBuyPrice =sellCostBuyPrice+9375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9375
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4687.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+25
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 10000, 9375, 9375
                    , 9375, 9375, 9375, 9375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9375, 4687.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10000, sellCostBuyPrice =sellCostBuyPrice+9375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9375
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4687.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1321';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1321', '1', '25', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '45', '20', '1', '2026-09-30 20:47:18','0','0'); -- id=1643
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+30 where id = 37;
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 ('570','01345', '26', '31', '1345', '30.00', '590', '17700', '0', '', '0', '2026-09-30 20:47:18', '1345', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','37-30,','1','1','0','0','590','17700','0','','0','0.00','0','0','0','0'); -- id=151
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 151;
 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 (1345, '2026-09-30', 17700, 17100, 17100
                    , 17100, 17100, 17100, 17100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 17100, 17100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17700, sellCostBuyPrice =sellCostBuyPrice+17100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+30
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 17700, 17100, 17100
                    , 17100, 17100, 17100, 17100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 17100, 17100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17700, sellCostBuyPrice =sellCostBuyPrice+17100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17100
                        , returnSellVal = returnSellVal+0, 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 = '18', userid = '1', storedetaildate = '2026-09-30 20:47:18' WHERE storedetailid = '1345';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1345', '1', '30', '1', '26', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '48', '18', '1', '2026-09-30 20:47:18','0','0'); -- id=1644
UPDATE dailyentry SET totalcreditor = '127280.00', totaldebtor = '127280.00', thedate = '2026-09-30', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 17:19:46', entryComment = 'اضافة فاتورة مبيعات رقم 20', fromFlag = '1',related='0',isopeningentry='0',operationId='20',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=20' WHERE id = '837';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '127280.00', '127280.00', '2026-09-30', '1', '0', '837', '2026-09-30 20:47:18','تم عكس القيد رقم 837 ','1','0','0','0','0',''); -- id=851
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('851', '497', '127280.00', '','0'); -- id=851
UPDATE accountstree SET name = 'محل VIP', customName = 'محل VIP', customNameEn = 'محل VIP', nameEn = 'محل VIP', parent = '58', accountNature = '0', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:40:12' WHERE id = '497';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('851', '143', '127280.00', '','0'); -- id=852
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '253270', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
UPDATE dailyentry SET totalcreditor = '122284.35', totaldebtor = '122284.35', thedate = '2026-09-30', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 17:19:46', entryComment = 'اضافة فاتورة مبيعات رقم 20 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='20',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=20' WHERE id = '838';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '122284.35', '122284.35', '2026-09-30', '1', '0', '838', '2026-09-30 20:47:18','تم عكس القيد رقم 838 ','1','0','0','0','0',''); -- id=852
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('852', '402', '122284.35', '','0'); -- id=852
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '248422.55', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('852', '382', '122284.35', '','0'); -- id=853
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12750862.45', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '127280', '127280', '2026-09-30', '1', '0', '0', '2026-09-30 20:47:18','اضافة فاتورة مبيعات رقم 26','1','0',null,'0','26','sellbillController.php?do=showDetail&sellbillid=26'); -- id=853
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('853', '496', '127280', '','0'); -- id=854
UPDATE accountstree SET name = 'محل الفيوم vip', customName = 'محل الفيوم vip', customNameEn = 'VIP', nameEn = 'VIP', parent = '58', accountNature = '0', theValue = '127280', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 20:39:05' WHERE id = '496';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('853', '143', '127280', '','0'); -- id=853
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '380550', 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 ( '122284.35', '122284.35', '2026-09-30', '1', '0', '0', '2026-09-30 20:47:18','اضافة فاتورة مبيعات رقم 26 - صرف البضاعة من المخزن','1','0',null,'0','26','sellbillController.php?do=showDetail&sellbillid=26'); -- id=854
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('854', '402', '122284.35', '','0'); -- id=855
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '370706.9', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('854', '382', '122284.35', '','0'); -- id=854
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12628578.1', 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='853,0,854' where sellbillid=26;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 127280, 122445, 122445
                    , 122445, 122284.35, 122284.35, 122284.35
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,122445, 115957.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+127280, sellCostBuyPrice =sellCostBuyPrice+122445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+122445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+122445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+122284.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+122284.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+122284.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+122445
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115957.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (4, '2026-09-30', 127280, 122445, 122445
                    , 122445, 122284.35, 122284.35, 122284.35
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,122445, 115957.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+127280, sellCostBuyPrice =sellCostBuyPrice+122445
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+122445, sellCostMeanBuyPrice = sellCostMeanBuyPrice+122445
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+122284.35, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+122284.35
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+122284.35
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+122445
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+115957.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 127280, 122445, 122445
                    , 122445, 122284.35, 122284.35, 122284.35, 122445, 115957.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+127280, netSellCostBuyPrice = netSellCostBuyPrice+122445
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+122445
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+122445
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+122284.35
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+122284.35
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+122284.35
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+122445
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+115957.5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 20 and newid=26 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:17:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:47:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:47:18', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editprint&id=26'); -- id=1446
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:17:32";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:47:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:47:32', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1447
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:17:35";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:47:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:47:35', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1448
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:17:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:47:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:47:55', '1', 'editsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=21'); -- id=1449
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:18:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:48:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:48:00', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=update'); -- id=1450
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 21;
UPDATE sellbill SET  sellbillsysdate = '2026-09-30 20:48:00', userid = '2',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '21';
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 102;
 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 (834, '2026-09-30', 8375, 7875, 7875
                    , 7875, 7875, 7875, 7875
                    , 0, 0, 0, 0
                    , 0, 0, 0,25,0, 7875, 7875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8375, sellCostBuyPrice =sellCostBuyPrice-7875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7875, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7875
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-25
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 8375, 7875, 7875
                    , 7875, 7875, 7875, 7875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7875, 7875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8375, sellCostBuyPrice =sellCostBuyPrice-7875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7875, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7875
                        , returnSellVal = returnSellVal-0, 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 = '50', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '834';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('834', '1', '25', '0', '21', 'تعديل فاتورة مبيعات', 'sellbillController.php', '25', '50', '1', '2026-09-30 17:20:33','0','0'); -- id=1645
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 103;
 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 (784, '2026-09-30', 1440, 1360, 1360
                    , 1360, 1360, 1360, 1360
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1360, 1360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1440, sellCostBuyPrice =sellCostBuyPrice-1360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1360, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1360
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-4
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1440, 1360, 1360
                    , 1360, 1360, 1360, 1360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1360, 1360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1440, sellCostBuyPrice =sellCostBuyPrice-1360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1360, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1360
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '19', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('784', '1', '4', '0', '21', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '19', '1', '2026-09-30 17:20:33','0','0'); -- id=1646
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 104;
 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 (893, '2026-09-30', 6800, 6400, 6400
                    , 6400, 6400, 6400, 6400
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 6400, 6400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6800, sellCostBuyPrice =sellCostBuyPrice-6400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6400
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-20
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6800, 6400, 6400
                    , 6400, 6400, 6400, 6400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6400, 6400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6800, sellCostBuyPrice =sellCostBuyPrice-6400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6400
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '893';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('893', '1', '20', '0', '21', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '20', '1', '2026-09-30 17:20:33','0','0'); -- id=1647
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 295.00
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 295
                where sellbilldetailid = 105;
 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 (775, '2026-09-30', 3780, 3540, 3540
                    , 3540, 3540, 3540, 3540
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 3540, 3540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3780, sellCostBuyPrice =sellCostBuyPrice-3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3540
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3540
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-12
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3780, 3540, 3540
                    , 3540, 3540, 3540, 3540
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3540, 3540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3780, sellCostBuyPrice =sellCostBuyPrice-3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3540
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3540
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '775';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('775', '1', '12', '0', '21', 'تعديل فاتورة مبيعات', 'sellbillController.php', '8', '20', '1', '2026-09-30 17:20:33','0','0'); -- id=1648
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 275, lastbuyprice_withDiscountAndTax = 275
                where sellbilldetailid = 106;
 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 (1129, '2026-09-30', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1770, sellCostBuyPrice =sellCostBuyPrice-1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-6
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1770, sellCostBuyPrice =sellCostBuyPrice-1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1650
                        , returnSellVal = returnSellVal-0, 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 = '638', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '1129';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1129', '1', '6', '0', '21', 'تعديل فاتورة مبيعات', 'sellbillController.php', '632', '638', '1', '2026-09-30 17:20:33','0','0'); -- id=1649
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 107;
 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 (891, '2026-09-30', 4800, 4500, 4500
                    , 4500, 4500, 4500, 4500
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 4500, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4800, sellCostBuyPrice =sellCostBuyPrice-4500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4500
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 4800, 4500, 4500
                    , 4500, 4500, 4500, 4500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4500, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4800, sellCostBuyPrice =sellCostBuyPrice-4500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4500
                        , returnSellVal = returnSellVal-0, 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 = '25', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '891';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('891', '1', '15', '0', '21', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '25', '1', '2026-09-30 17:20:33','0','0'); -- id=1650
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 310, lastbuyprice_withDiscountAndTax = 310
                where sellbilldetailid = 108;
 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 (1080, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1650, sellCostBuyPrice =sellCostBuyPrice-1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1550
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1650, sellCostBuyPrice =sellCostBuyPrice-1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1550
                        , returnSellVal = returnSellVal-0, 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 = '45', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '1080';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1080', '1', '5', '0', '21', 'تعديل فاتورة مبيعات', 'sellbillController.php', '40', '45', '1', '2026-09-30 17:20:33','0','0'); -- id=1651
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.00','1','تعديل فاتورة مبيعات','21', '0', '2026-09-30 17:20:33', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '28615', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 17:20:33','0','0','',''); -- id=44
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '162115',  userid = '1' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('190730','28615', '1', '2', 'تعديل فاتورة مبيعات', '21', '162115', '2026-09-30 20:48:00', '1',  'sellbillController.php','1','','0'); -- id=38
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,26875, 26875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-28615, sellCostBuyPrice =sellCostBuyPrice-26875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-26875, sellCostMeanBuyPrice = sellCostMeanBuyPrice-26875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-26875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-26875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-26875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-26875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-26875
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 26875, 26875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-28615, sellCostBuyPrice =sellCostBuyPrice-26875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-26875, sellCostMeanBuyPrice = sellCostMeanBuyPrice-26875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-26875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-26875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-26875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-26875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-26875
                        , returnSellVal = returnSellVal-0, 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, 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875, 26875, 26875)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-28615, netSellCostBuyPrice = netSellCostBuyPrice-26875
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-26875
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-26875
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-26875
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-26875
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-26875
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-26875
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-26875;

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


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

COMMIT;
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,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,shipfrom,shipto,paymethodshipping,whatShippingCost,sellbilltypeclientid,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 17:20:33', '06abd14ca666f8', '1', '0.00', '0', '0', '1', '28615', '28615', '28615', '0', '1', '2026-09-30 17:20:33', '', '1', '0', 'نقدي', '2', '0', '3', '0', 'محل عروض', '87', '21', 'sellbillController', '0','','','','','-1','0','0','28615','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-30','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0',''); -- id=27
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','اضافة فاتورة مبيعات (معدله)','27', '0', '2026-09-30 20:48:00', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '28615', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 17:20:33','0','0','',''); -- id=45
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('315','78068', '27', '19', '834', '25.00', '335', '8375', '0', '', '0', '2026-09-30 20:48:00', '834', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','335','8375','0','','0','0.00','0','0','0','0'); -- id=152
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 152;
 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 (834, '2026-09-30', 8375, 7875, 7875
                    , 7875, 7875, 7875, 7875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 25, 0, 7875, 7875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8375, sellCostBuyPrice =sellCostBuyPrice+7875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7875
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+25
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 8375, 7875, 7875
                    , 7875, 7875, 7875, 7875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7875, 7875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8375, sellCostBuyPrice =sellCostBuyPrice+7875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7875
                        , returnSellVal = returnSellVal+0, 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 = '25', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '834';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('834', '1', '25', '1', '27', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '50', '25', '1', '2026-09-30 20:48:00','0','0'); -- id=1652
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 ('340','08354', '27', '13', '784', '4.00', '360', '1440', '0', '', '0', '2026-09-30 20:48:00', '784', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','360','1440','0','','0','0.00','0','0','0','0'); -- id=153
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 153;
 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 (784, '2026-09-30', 1440, 1360, 1360
                    , 1360, 1360, 1360, 1360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1360, 1360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440, sellCostBuyPrice =sellCostBuyPrice+1360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1440, 1360, 1360
                    , 1360, 1360, 1360, 1360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1360, 1360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440, sellCostBuyPrice =sellCostBuyPrice+1360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('784', '1', '4', '1', '27', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '19', '15', '1', '2026-09-30 20:48:00','0','0'); -- id=1653
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 ('320','08564', '27', '25', '893', '20.00', '340', '6800', '0', '', '0', '2026-09-30 20:48:00', '893', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','340','6800','0','','0','0.00','0','0','0','0'); -- id=154
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 154;
 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 (893, '2026-09-30', 6800, 6400, 6400
                    , 6400, 6400, 6400, 6400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 6400, 6400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6800, sellCostBuyPrice =sellCostBuyPrice+6400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6800, 6400, 6400
                    , 6400, 6400, 6400, 6400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6400, 6400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6800, sellCostBuyPrice =sellCostBuyPrice+6400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '893';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('893', '1', '20', '1', '27', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '0', '1', '2026-09-30 20:48:00','0','0'); -- id=1654
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 ('295','08585', '27', '13', '775', '12.00', '315', '3780', '0', '', '0', '2026-09-30 20:48:00', '775', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','315','3780','0','','0','0.00','0','0','0','0'); -- id=155
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 295.00
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 295
                where sellbilldetailid = 155;
 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 (775, '2026-09-30', 3780, 3540, 3540
                    , 3540, 3540, 3540, 3540
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3540, 3540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3540
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3780, 3540, 3540
                    , 3540, 3540, 3540, 3540
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3540, 3540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3540
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '775';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('775', '1', '12', '1', '27', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '8', '1', '2026-09-30 20:48:00','0','0'); -- id=1655
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('275','07110', '27', '40', '1129', '6.00', '295', '1770', '0', '', '0', '2026-09-30 20:48:00', '1129', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','295','1770','0','','0','0.00','0','0','0','0'); -- id=156
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 275, lastbuyprice_withDiscountAndTax = 275
                where sellbilldetailid = 156;
 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 (1129, '2026-09-30', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+6
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1650
                        , returnSellVal = returnSellVal+0, 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 = '632', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '1129';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1129', '1', '6', '1', '27', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '638', '632', '1', '2026-09-30 20:48:00','0','0'); -- id=1656
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 ('300','08562', '27', '25', '891', '15.00', '320', '4800', '0', '', '0', '2026-09-30 20:48:00', '891', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','320','4800','0','','0','0.00','0','0','0','0'); -- id=157
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 157;
 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 (891, '2026-09-30', 4800, 4500, 4500
                    , 4500, 4500, 4500, 4500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 4500, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4800, sellCostBuyPrice =sellCostBuyPrice+4500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 4800, 4500, 4500
                    , 4500, 4500, 4500, 4500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4500, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4800, sellCostBuyPrice =sellCostBuyPrice+4500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '891';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('891', '1', '15', '1', '27', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '25', '10', '1', '2026-09-30 20:48:00','0','0'); -- id=1657
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 ('310','07114', '27', '36', '1080', '5.00', '330', '1650', '0', '', '0', '2026-09-30 20:48:00', '1080', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','330','1650','0','','0','0.00','0','0','0','0'); -- id=158
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 310, lastbuyprice_withDiscountAndTax = 310
                where sellbilldetailid = 158;
 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 (1080, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1550
                        , returnSellVal = returnSellVal+0, 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 = '40', userid = '1', storedetaildate = '2026-09-30 20:48:00' WHERE storedetailid = '1080';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1080', '1', '5', '1', '27', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '45', '40', '1', '2026-09-30 20:48:00','0','0'); -- id=1658
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '190730',  userid = '1' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('162115','28615', '0', '2', 'اضافة فاتورة مبيعات (معدله)', '27', '190730', '2026-09-30 20:48:00', '1',  'sellbillController.php','1','','0'); -- id=39
UPDATE dailyentry SET totalcreditor = '28615.00', totaldebtor = '28615.00', thedate = '2026-09-30', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 17:20:33', entryComment = 'اضافة فاتورة مبيعات رقم 21', fromFlag = '1',related='0',isopeningentry='0',operationId='21',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=21' WHERE id = '839';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '28615.00', '28615.00', '2026-09-30', '1', '0', '839', '2026-09-30 20:48:00','تم عكس القيد رقم 839 ','1','0','0','0','0',''); -- id=855
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('855', '419', '28615.00', '','0'); -- id=855
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '162115', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('855', '143', '28615.00', '','0'); -- id=856
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '351935', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
UPDATE dailyentry SET totalcreditor = '26875.00', totaldebtor = '26875.00', thedate = '2026-09-30', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 17:20:33', entryComment = 'اضافة فاتورة مبيعات رقم 21 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='21',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=21' WHERE id = '840';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '26875.00', '26875.00', '2026-09-30', '1', '0', '840', '2026-09-30 20:48:00','تم عكس القيد رقم 840 ','1','0','0','0','0',''); -- id=856
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('856', '402', '26875.00', '','0'); -- id=856
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '343831.9', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('856', '382', '26875.00', '','0'); -- id=857
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12655453.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '28615', '28615', '2026-09-30', '1', '0', '0', '2026-09-30 20:48:00','اضافة فاتورة مبيعات رقم 27','1','0',null,'0','27','sellbillController.php?do=showDetail&sellbillid=27'); -- id=857
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('857', '419', '28615', '','0'); -- id=858
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '190730', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('857', '143', '28615', '','0'); -- id=857
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '380550', 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 ( '26875', '26875', '2026-09-30', '1', '0', '0', '2026-09-30 20:48:00','اضافة فاتورة مبيعات رقم 27 - صرف البضاعة من المخزن','1','0',null,'0','27','sellbillController.php?do=showDetail&sellbillid=27'); -- id=858
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('858', '402', '26875', '','0'); -- id=859
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '370706.9', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('858', '382', '26875', '','0'); -- id=858
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12628578.1', 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='857,0,858' where sellbillid=27;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,26875, 26875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+28615, sellCostBuyPrice =sellCostBuyPrice+26875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+26875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+26875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+26875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26875
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,26875, 26875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+28615, sellCostBuyPrice =sellCostBuyPrice+26875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+26875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+26875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+26875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26875
                        , returnSellVal = returnSellVal+0, 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, 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875, 26875, 26875)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+28615, netSellCostBuyPrice = netSellCostBuyPrice+26875
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+26875
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+26875
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+26875
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+26875
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+26875
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+26875
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+26875;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 21 and newid=27 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:18:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:48:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:48:00', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editprint&id=27'); -- id=1451
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:18:10";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:48:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:48:10', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1452
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:18:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:48:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:48:13', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1453
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:18:34";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:48:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:48:34', '1', 'editsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=27'); -- id=1454
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:19:01";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:49:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:49:01', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=update'); -- id=1455
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 27;
UPDATE sellbill SET  sellbillsysdate = '2026-09-30 20:49:01', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '27';
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 152;
 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 (834, '2026-09-30', 8375, 7875, 7875
                    , 7875, 7875, 7875, 7875
                    , 0, 0, 0, 0
                    , 0, 0, 0,25,0, 7875, 7875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8375, sellCostBuyPrice =sellCostBuyPrice-7875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7875, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7875
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-25
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 8375, 7875, 7875
                    , 7875, 7875, 7875, 7875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7875, 7875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8375, sellCostBuyPrice =sellCostBuyPrice-7875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7875, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7875
                        , returnSellVal = returnSellVal-0, 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 = '50', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '834';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('834', '1', '25', '0', '27', 'تعديل فاتورة مبيعات', 'sellbillController.php', '25', '50', '1', '2026-09-30 17:20:33','0','0'); -- id=1659
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 153;
 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 (784, '2026-09-30', 1440, 1360, 1360
                    , 1360, 1360, 1360, 1360
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1360, 1360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1440, sellCostBuyPrice =sellCostBuyPrice-1360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1360, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1360
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-4
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1440, 1360, 1360
                    , 1360, 1360, 1360, 1360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1360, 1360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1440, sellCostBuyPrice =sellCostBuyPrice-1360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1360, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1360
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '19', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('784', '1', '4', '0', '27', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '19', '1', '2026-09-30 17:20:33','0','0'); -- id=1660
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 154;
 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 (893, '2026-09-30', 6800, 6400, 6400
                    , 6400, 6400, 6400, 6400
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 6400, 6400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6800, sellCostBuyPrice =sellCostBuyPrice-6400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6400
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-20
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6800, 6400, 6400
                    , 6400, 6400, 6400, 6400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6400, 6400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6800, sellCostBuyPrice =sellCostBuyPrice-6400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6400
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '893';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('893', '1', '20', '0', '27', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '20', '1', '2026-09-30 17:20:33','0','0'); -- id=1661
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 295.00
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 295
                where sellbilldetailid = 155;
 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 (775, '2026-09-30', 3780, 3540, 3540
                    , 3540, 3540, 3540, 3540
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 3540, 3540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3780, sellCostBuyPrice =sellCostBuyPrice-3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3540
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3540
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-12
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3780, 3540, 3540
                    , 3540, 3540, 3540, 3540
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3540, 3540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3780, sellCostBuyPrice =sellCostBuyPrice-3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3540
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3540
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '775';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('775', '1', '12', '0', '27', 'تعديل فاتورة مبيعات', 'sellbillController.php', '8', '20', '1', '2026-09-30 17:20:33','0','0'); -- id=1662
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 275, lastbuyprice_withDiscountAndTax = 275
                where sellbilldetailid = 156;
 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 (1129, '2026-09-30', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1770, sellCostBuyPrice =sellCostBuyPrice-1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-6
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1770, sellCostBuyPrice =sellCostBuyPrice-1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1650
                        , returnSellVal = returnSellVal-0, 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 = '638', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '1129';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1129', '1', '6', '0', '27', 'تعديل فاتورة مبيعات', 'sellbillController.php', '632', '638', '1', '2026-09-30 17:20:33','0','0'); -- id=1663
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 157;
 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 (891, '2026-09-30', 4800, 4500, 4500
                    , 4500, 4500, 4500, 4500
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 4500, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4800, sellCostBuyPrice =sellCostBuyPrice-4500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4500
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 4800, 4500, 4500
                    , 4500, 4500, 4500, 4500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4500, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4800, sellCostBuyPrice =sellCostBuyPrice-4500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4500, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4500
                        , returnSellVal = returnSellVal-0, 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 = '25', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '891';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('891', '1', '15', '0', '27', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '25', '1', '2026-09-30 17:20:33','0','0'); -- id=1664
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 310, lastbuyprice_withDiscountAndTax = 310
                where sellbilldetailid = 158;
 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 (1080, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1650, sellCostBuyPrice =sellCostBuyPrice-1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1550
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1650, sellCostBuyPrice =sellCostBuyPrice-1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1550
                        , returnSellVal = returnSellVal-0, 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 = '45', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '1080';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1080', '1', '5', '0', '27', 'تعديل فاتورة مبيعات', 'sellbillController.php', '40', '45', '1', '2026-09-30 17:20:33','0','0'); -- id=1665
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.00','1','تعديل فاتورة مبيعات','27', '0', '2026-09-30 17:20:33', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '28615', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 17:20:33','0','0','',''); -- id=46
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '162115',  userid = '1' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('190730','28615', '1', '2', 'تعديل فاتورة مبيعات', '27', '162115', '2026-09-30 20:49:01', '1',  'sellbillController.php','1','','0'); -- id=40
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,26875, 26875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-28615, sellCostBuyPrice =sellCostBuyPrice-26875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-26875, sellCostMeanBuyPrice = sellCostMeanBuyPrice-26875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-26875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-26875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-26875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-26875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-26875
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 26875, 26875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-28615, sellCostBuyPrice =sellCostBuyPrice-26875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-26875, sellCostMeanBuyPrice = sellCostMeanBuyPrice-26875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-26875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-26875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-26875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-26875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-26875
                        , returnSellVal = returnSellVal-0, 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, 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875, 26875, 26875)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-28615, netSellCostBuyPrice = netSellCostBuyPrice-26875
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-26875
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-26875
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-26875
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-26875
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-26875
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-26875
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-26875;

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


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

COMMIT;
BEGIN;
CALL clientInUse(3,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,shipfrom,shipto,paymethodshipping,whatShippingCost,sellbilltypeclientid,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 17:20:33', '06abd14ca666f8', '3', '0.00', '28615', '0', '1', '28615', '28615', '0', '28615', '1', '2026-09-30 17:20:33', '', '1', '0', 'محل الفيوم عروض', '2', '1', '3', '0', 'محل الفيوم عروض', '87', '27', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-30','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0',''); -- id=28
UPDATE client SET  clientdebt = '28615', userid = '1' WHERE clientid = '3';
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 ('3','0.00','28615','0','اضافة فاتورة مبيعات (معدله)','28', '28615', '2026-09-30 20:49:01', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '28615', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 17:20:33','0','0','',''); -- id=47
UPDATE client SET  inUse = 0 where clientid = 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 ('315','78068', '28', '19', '834', '25.00', '335', '8375', '0', '', '0', '2026-09-30 20:49:01', '834', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','335','8375','0','','0','0.00','0','0','0','0'); -- id=159
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 159;
 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 (834, '2026-09-30', 8375, 7875, 7875
                    , 7875, 7875, 7875, 7875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 25, 0, 7875, 7875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8375, sellCostBuyPrice =sellCostBuyPrice+7875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7875
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+25
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 8375, 7875, 7875
                    , 7875, 7875, 7875, 7875
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7875, 7875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8375, sellCostBuyPrice =sellCostBuyPrice+7875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7875
                        , returnSellVal = returnSellVal+0, 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 = '25', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '834';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('834', '1', '25', '1', '28', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '50', '25', '1', '2026-09-30 20:49:01','0','0'); -- id=1666
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 ('340','08354', '28', '13', '784', '4.00', '360', '1440', '0', '', '0', '2026-09-30 20:49:01', '784', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','360','1440','0','','0','0.00','0','0','0','0'); -- id=160
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 160;
 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 (784, '2026-09-30', 1440, 1360, 1360
                    , 1360, 1360, 1360, 1360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1360, 1360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440, sellCostBuyPrice =sellCostBuyPrice+1360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1440, 1360, 1360
                    , 1360, 1360, 1360, 1360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1360, 1360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1440, sellCostBuyPrice =sellCostBuyPrice+1360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('784', '1', '4', '1', '28', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '19', '15', '1', '2026-09-30 20:49:01','0','0'); -- id=1667
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 ('320','08564', '28', '25', '893', '20.00', '340', '6800', '0', '', '0', '2026-09-30 20:49:01', '893', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','340','6800','0','','0','0.00','0','0','0','0'); -- id=161
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 161;
 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 (893, '2026-09-30', 6800, 6400, 6400
                    , 6400, 6400, 6400, 6400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 6400, 6400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6800, sellCostBuyPrice =sellCostBuyPrice+6400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6800, 6400, 6400
                    , 6400, 6400, 6400, 6400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6400, 6400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6800, sellCostBuyPrice =sellCostBuyPrice+6400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '893';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('893', '1', '20', '1', '28', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '0', '1', '2026-09-30 20:49:01','0','0'); -- id=1668
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 ('295','08585', '28', '13', '775', '12.00', '315', '3780', '0', '', '0', '2026-09-30 20:49:01', '775', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','315','3780','0','','0','0.00','0','0','0','0'); -- id=162
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 295.00
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 295
                where sellbilldetailid = 162;
 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 (775, '2026-09-30', 3780, 3540, 3540
                    , 3540, 3540, 3540, 3540
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3540, 3540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3540
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3780, 3540, 3540
                    , 3540, 3540, 3540, 3540
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3540, 3540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3540
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3540, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3540, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3540
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3540
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '775';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('775', '1', '12', '1', '28', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '8', '1', '2026-09-30 20:49:01','0','0'); -- id=1669
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('275','07110', '28', '40', '1129', '6.00', '295', '1770', '0', '', '0', '2026-09-30 20:49:01', '1129', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','295','1770','0','','0','0.00','0','0','0','0'); -- id=163
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 275, lastbuyprice_withDiscountAndTax = 275
                where sellbilldetailid = 163;
 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 (1129, '2026-09-30', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+6
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1650
                        , returnSellVal = returnSellVal+0, 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 = '632', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '1129';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1129', '1', '6', '1', '28', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '638', '632', '1', '2026-09-30 20:49:01','0','0'); -- id=1670
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 ('300','08562', '28', '25', '891', '15.00', '320', '4800', '0', '', '0', '2026-09-30 20:49:01', '891', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','320','4800','0','','0','0.00','0','0','0','0'); -- id=164
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 164;
 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 (891, '2026-09-30', 4800, 4500, 4500
                    , 4500, 4500, 4500, 4500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 4500, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4800, sellCostBuyPrice =sellCostBuyPrice+4500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 4800, 4500, 4500
                    , 4500, 4500, 4500, 4500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4500, 4500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4800, sellCostBuyPrice =sellCostBuyPrice+4500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '891';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('891', '1', '15', '1', '28', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '25', '10', '1', '2026-09-30 20:49:01','0','0'); -- id=1671
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 ('310','07114', '28', '36', '1080', '5.00', '330', '1650', '0', '', '0', '2026-09-30 20:49:01', '1080', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','330','1650','0','','0','0.00','0','0','0','0'); -- id=165
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 310, lastbuyprice_withDiscountAndTax = 310
                where sellbilldetailid = 165;
 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 (1080, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1550
                        , returnSellVal = returnSellVal+0, 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 = '40', userid = '1', storedetaildate = '2026-09-30 20:49:01' WHERE storedetailid = '1080';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1080', '1', '5', '1', '28', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '45', '40', '1', '2026-09-30 20:49:01','0','0'); -- id=1672
UPDATE dailyentry SET totalcreditor = '28615.00', totaldebtor = '28615.00', thedate = '2026-09-30', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 20:48:00', entryComment = 'اضافة فاتورة مبيعات رقم 27', fromFlag = '1',related='0',isopeningentry='0',operationId='27',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=27' WHERE id = '857';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '28615.00', '28615.00', '2026-09-30', '1', '0', '857', '2026-09-30 20:49:01','تم عكس القيد رقم 857 ','1','0','0','0','0',''); -- id=859
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('859', '419', '28615.00', '','0'); -- id=859
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '162115', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('859', '143', '28615.00', '','0'); -- id=860
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '351935', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
UPDATE dailyentry SET totalcreditor = '26875.00', totaldebtor = '26875.00', thedate = '2026-09-30', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 20:48:00', entryComment = 'اضافة فاتورة مبيعات رقم 27 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='27',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=27' WHERE id = '858';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '26875.00', '26875.00', '2026-09-30', '1', '0', '858', '2026-09-30 20:49:01','تم عكس القيد رقم 858 ','1','0','0','0','0',''); -- id=860
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('860', '402', '26875.00', '','0'); -- id=860
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '343831.9', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('860', '382', '26875.00', '','0'); -- id=861
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12655453.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '28615', '28615', '2026-09-30', '1', '0', '0', '2026-09-30 20:49:01','اضافة فاتورة مبيعات رقم 28','1','0',null,'0','28','sellbillController.php?do=showDetail&sellbillid=28'); -- id=861
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('861', '495', '28615', '','0'); -- id=862
UPDATE accountstree SET name = 'محل الفيوم عروض', customName = 'محل الفيوم عروض', customNameEn = 'محل الفيوم عروض', nameEn = 'محل الفيوم عروض', parent = '58', accountNature = '0', theValue = '28615', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:30:47' WHERE id = '495';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('861', '143', '28615', '','0'); -- id=861
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '380550', 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 ( '26875', '26875', '2026-09-30', '1', '0', '0', '2026-09-30 20:49:01','اضافة فاتورة مبيعات رقم 28 - صرف البضاعة من المخزن','1','0',null,'0','28','sellbillController.php?do=showDetail&sellbillid=28'); -- id=862
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('862', '402', '26875', '','0'); -- id=863
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '370706.9', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('862', '382', '26875', '','0'); -- id=862
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12628578.1', 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='861,0,862' where sellbillid=28;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,26875, 26875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+28615, sellCostBuyPrice =sellCostBuyPrice+26875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+26875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+26875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+26875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26875
                        , returnSellVal = returnSellVal+0, 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 (3, '2026-09-30', 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,26875, 26875, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+28615, sellCostBuyPrice =sellCostBuyPrice+26875
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+26875, sellCostMeanBuyPrice = sellCostMeanBuyPrice+26875
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26875, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+26875
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26875
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+26875
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26875
                        , returnSellVal = returnSellVal+0, 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, 28615, 26875, 26875
                    , 26875, 26875, 26875, 26875, 26875, 26875)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+28615, netSellCostBuyPrice = netSellCostBuyPrice+26875
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+26875
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+26875
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+26875
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+26875
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+26875
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+26875
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+26875;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 27 and newid=28 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:19:01";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:49:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:49:01', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editprint&id=28'); -- id=1456
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:19:06";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:49:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:49:06', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1457
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:19:14";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:49:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:49:14', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1458
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:19:32";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:49:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:49:32', '1', 'editsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=22'); -- id=1459
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:19:53";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:49:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:49:53', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=update'); -- id=1460
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 22;
UPDATE sellbill SET  sellbillsysdate = '2026-09-30 20:49:53', userid = '1',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '22';
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 109;
 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 (1139, '2026-09-30', 1140, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1140, sellCostBuyPrice =sellCostBuyPrice-1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1260
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-4
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1140, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1140, sellCostBuyPrice =sellCostBuyPrice-1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1260
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2026-09-30 20:49:53' WHERE storedetailid = '1139';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1139', '1', '4', '0', '22', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '4', '1', '2026-09-30 18:15:55','0','0'); -- id=1673
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 110;
 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 (1139, '2026-09-30', 1140, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1140, sellCostBuyPrice =sellCostBuyPrice-1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1260
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-4
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1140, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1140, sellCostBuyPrice =sellCostBuyPrice-1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1260
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2026-09-30 20:49:53' WHERE storedetailid = '1139';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1139', '1', '4', '0', '22', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '8', '1', '2026-09-30 18:15:55','0','0'); -- id=1674
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 111;
 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 (1250, '2026-09-30', 2400, 2880, 2880
                    , 2880, 2880, 2880, 2880
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 2880, 2880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2400, sellCostBuyPrice =sellCostBuyPrice-2880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2880
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-12
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2400, 2880, 2880
                    , 2880, 2880, 2880, 2880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2880, 2880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2400, sellCostBuyPrice =sellCostBuyPrice-2880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2880
                        , returnSellVal = returnSellVal-0, 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 = '2026-09-30 20:49:53' WHERE storedetailid = '1250';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1250', '1', '12', '0', '22', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '12', '1', '2026-09-30 18:15:55','0','0'); -- id=1675
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 112;
 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 (1136, '2026-09-30', 2100, 2310, 2310
                    , 2310, 2310, 2310, 2310
                    , 0, 0, 0, 0
                    , 0, 0, 0,7,0, 2310, 2310, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2100, sellCostBuyPrice =sellCostBuyPrice-2310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2310, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2310
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-7
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2100, 2310, 2310
                    , 2310, 2310, 2310, 2310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2310, 2310, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2100, sellCostBuyPrice =sellCostBuyPrice-2310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2310, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2310
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2026-09-30 20:49:53' WHERE storedetailid = '1136';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1136', '1', '7', '0', '22', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '7', '1', '2026-09-30 18:15:55','0','0'); -- id=1676
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 113;
 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 (1145, '2026-09-30', 1480, 1400, 1400
                    , 1400, 1400, 1400, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1400, 1400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1480, sellCostBuyPrice =sellCostBuyPrice-1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1400
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-4
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1480, 1400, 1400
                    , 1400, 1400, 1400, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1400, 1400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1480, sellCostBuyPrice =sellCostBuyPrice-1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1400
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2026-09-30 20:49:53' WHERE storedetailid = '1145';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1145', '1', '4', '0', '22', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '4', '1', '2026-09-30 18:15:55','0','0'); -- id=1677
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 355.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 355.00
        , lastbuyprice_withTax = 355, meanbuyprice_withTax = 355, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 114;
 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 (1245, '2026-09-30', 1040, 1440, 1400
                    , 1420, 1400, 1420, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1420, 1420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1040, sellCostBuyPrice =sellCostBuyPrice-1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1420
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-4
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1040, 1440, 1400
                    , 1420, 1400, 1420, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1420, 1420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1040, sellCostBuyPrice =sellCostBuyPrice-1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1420
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2026-09-30 20:49:53' WHERE storedetailid = '1245';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1245', '1', '4', '0', '22', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '4', '1', '2026-09-30 18:15:55','0','0'); -- id=1678
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 115;
 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 (1360, '2026-09-30', 1040, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1040, sellCostBuyPrice =sellCostBuyPrice-1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-4
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1040, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1040, sellCostBuyPrice =sellCostBuyPrice-1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2026-09-30 20:49:53' WHERE storedetailid = '1360';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1360', '1', '4', '0', '22', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '4', '1', '2026-09-30 18:15:55','0','0'); -- id=1679
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.00','1','تعديل فاتورة مبيعات','22', '0', '2026-09-30 18:15:55', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '10340', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 18:15:55','0','0','',''); -- id=48
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-1024750',  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 ('-1014410','10340', '1', '1', 'تعديل فاتورة مبيعات', '22', '-1024750', '2026-09-30 20:49:53', '1',  'sellbillController.php','1','','0'); -- id=41
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 10340, 11550, 11510
                    , 11530, 11510, 11530, 11510
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11530, 11530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-10340, sellCostBuyPrice =sellCostBuyPrice-11550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-11510, sellCostMeanBuyPrice = sellCostMeanBuyPrice-11530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-11510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-11530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-11510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-11530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-11530
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 10340, 11550, 11510
                    , 11530, 11510, 11530, 11510
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11530, 11530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-10340, sellCostBuyPrice =sellCostBuyPrice-11550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-11510, sellCostMeanBuyPrice = sellCostMeanBuyPrice-11530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-11510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-11530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-11510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-11530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-11530
                        , returnSellVal = returnSellVal-0, 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, 10340, 11550, 11510
                    , 11530, 11510, 11530, 11510, 11530, 11530)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-10340, netSellCostBuyPrice = netSellCostBuyPrice-11550
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-11510
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-11530
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-11510
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-11530
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-11510
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-11530
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-11530;

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


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

COMMIT;
BEGIN;
CALL clientInUse(3,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,shipfrom,shipto,paymethodshipping,whatShippingCost,sellbilltypeclientid,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 18:15:55', '06abd2639c3ce5', '3', '28615.00', '38955', '0', '1', '10340', '10340', '0', '10340', '1', '2026-09-30 18:15:55', '', '1', '0', 'محل الفيوم عروض', '1', '1', '3', '0', 'محل الفيوم عروض', '39', '22', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-30','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0',''); -- id=29
UPDATE client SET  clientdebt = '38955', userid = '1' WHERE clientid = '3';
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 ('3','28615.00','10340','0','اضافة فاتورة مبيعات (معدله)','29', '38955', '2026-09-30 20:49:53', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '10340', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 18:15:55','0','0','',''); -- id=49
UPDATE client SET  inUse = 0 where clientid = 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 ('315','05944', '29', '42', '1139', '4.00', '285', '1140', '0', '', '0', '2026-09-30 20:49:53', '1139', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','285','1140','0','','0','0.00','0','0','0','0'); -- id=166
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 166;
 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 (1139, '2026-09-30', 1140, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1140, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1140, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1140, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2026-09-30 20:49:53' WHERE storedetailid = '1139';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1139', '1', '4', '1', '29', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '4', '1', '2026-09-30 20:49:53','0','0'); -- id=1680
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 ('315','05944', '29', '42', '1139', '4.00', '285', '1140', '0', '', '0', '2026-09-30 20:49:53', '1139', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','285','1140','0','','0','0.00','0','0','0','0'); -- id=167
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 167;
 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 (1139, '2026-09-30', 1140, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1140, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1140, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1140, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:49:53' WHERE storedetailid = '1139';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1139', '1', '4', '1', '29', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '0', '1', '2026-09-30 20:49:53','0','0'); -- id=1681
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 ('240','07891', '29', '72', '1250', '12.00', '200', '2400', '0', '', '0', '2026-09-30 20:49:53', '1250', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','200','2400','0','','0','0.00','0','0','0','0'); -- id=168
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 168;
 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 (1250, '2026-09-30', 2400, 2880, 2880
                    , 2880, 2880, 2880, 2880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 2880, 2880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2400, 2880, 2880
                    , 2880, 2880, 2880, 2880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2880, 2880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:49:53' WHERE storedetailid = '1250';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1250', '1', '12', '1', '29', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '12', '0', '1', '2026-09-30 20:49:53','0','0'); -- id=1682
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 ('330','05504', '29', '42', '1136', '7.00', '300', '2100', '0', '', '0', '2026-09-30 20:49:53', '1136', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','300','2100','0','','0','0.00','0','0','0','0'); -- id=169
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 169;
 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 (1136, '2026-09-30', 2100, 2310, 2310
                    , 2310, 2310, 2310, 2310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7, 0, 2310, 2310, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2310
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+7
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2100, 2310, 2310
                    , 2310, 2310, 2310, 2310
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2310, 2310, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2310
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2310, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2310
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2310, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2310
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2310
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2310
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2310
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:49:53' WHERE storedetailid = '1136';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1136', '1', '7', '1', '29', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '7', '0', '1', '2026-09-30 20:49:53','0','0'); -- id=1683
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 ('350','08549', '29', '42', '1145', '4.00', '370', '1480', '0', '', '0', '2026-09-30 20:49:53', '1145', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','370','1480','0','','0','0.00','0','0','0','0'); -- id=170
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 170;
 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 (1145, '2026-09-30', 1480, 1400, 1400
                    , 1400, 1400, 1400, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1400, 1400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1480, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1480, 1400, 1400
                    , 1400, 1400, 1400, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1400, 1400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1480, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:49:53' WHERE storedetailid = '1145';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1145', '1', '4', '1', '29', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '0', '1', '2026-09-30 20:49:53','0','0'); -- id=1684
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 ('360','08568', '29', '71', '1245', '4.00', '260', '1040', '0', '', '0', '2026-09-30 20:49:53', '1245', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','260','1040','0','','0','0.00','0','0','0','0'); -- id=171
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 355.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 355.00
        , lastbuyprice_withTax = 355, meanbuyprice_withTax = 355, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 171;
 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 (1245, '2026-09-30', 1040, 1440, 1400
                    , 1420, 1400, 1420, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1420, 1420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1040, 1440, 1400
                    , 1420, 1400, 1420, 1400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1420, 1420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:49:53' WHERE storedetailid = '1245';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1245', '1', '4', '1', '29', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '0', '1', '2026-09-30 20:49:53','0','0'); -- id=1685
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','08345', '29', '71', '1360', '4.00', '260', '1040', '0', '', '0', '2026-09-30 20:49:53', '1360', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','260','1040','0','','0','0.00','0','0','0','0'); -- id=172
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 172;
 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 (1360, '2026-09-30', 1040, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1040, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1040, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:49:53' WHERE storedetailid = '1360';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1360', '1', '4', '1', '29', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '0', '1', '2026-09-30 20:49:53','0','0'); -- id=1686
UPDATE dailyentry SET totalcreditor = '10340.00', totaldebtor = '10340.00', thedate = '2026-09-30', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 18:15:55', entryComment = 'اضافة فاتورة مبيعات رقم 22', fromFlag = '1',related='0',isopeningentry='0',operationId='22',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=22' WHERE id = '843';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10340.00', '10340.00', '2026-09-30', '1', '0', '843', '2026-09-30 20:49:53','تم عكس القيد رقم 843 ','1','0','0','0','0',''); -- id=863
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('863', '383', '10340.00', '','0'); -- id=863
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-1024750', 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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('863', '143', '10340.00', '','0'); -- id=864
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '370210', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
UPDATE dailyentry SET totalcreditor = '11510.00', totaldebtor = '11510.00', thedate = '2026-09-30', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 18:15:55', entryComment = 'اضافة فاتورة مبيعات رقم 22 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='22',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=22' WHERE id = '844';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '11510.00', '11510.00', '2026-09-30', '1', '0', '844', '2026-09-30 20:49:53','تم عكس القيد رقم 844 ','1','0','0','0','0',''); -- id=864
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('864', '402', '11510.00', '','0'); -- id=864
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '359196.9', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('864', '382', '11510.00', '','0'); -- id=865
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12640088.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10340', '10340', '2026-09-30', '1', '0', '0', '2026-09-30 20:49:53','اضافة فاتورة مبيعات رقم 29','1','0',null,'0','29','sellbillController.php?do=showDetail&sellbillid=29'); -- id=865
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('865', '495', '10340', '','0'); -- id=866
UPDATE accountstree SET name = 'محل الفيوم عروض', customName = 'محل الفيوم عروض', customNameEn = 'محل الفيوم عروض', nameEn = 'محل الفيوم عروض', parent = '58', accountNature = '0', theValue = '38955', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:30:47' WHERE id = '495';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('865', '143', '10340', '','0'); -- id=865
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '380550', 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 ( '11510', '11510', '2026-09-30', '1', '0', '0', '2026-09-30 20:49:53','اضافة فاتورة مبيعات رقم 29 - صرف البضاعة من المخزن','1','0',null,'0','29','sellbillController.php?do=showDetail&sellbillid=29'); -- id=866
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('866', '402', '11510', '','0'); -- id=867
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '370706.9', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('866', '382', '11510', '','0'); -- id=866
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12628578.1', 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='865,0,866' 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 ('2026-09-30', 10340, 11550, 11510
                    , 11530, 11510, 11530, 11510
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11530, 11530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10340, sellCostBuyPrice =sellCostBuyPrice+11550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11530
                        , returnSellVal = returnSellVal+0, 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 (3, '2026-09-30', 10340, 11550, 11510
                    , 11530, 11510, 11530, 11510
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11530, 11530, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10340, sellCostBuyPrice =sellCostBuyPrice+11550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11510, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11530
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11510, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11530
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11510
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11530
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11530
                        , returnSellVal = returnSellVal+0, 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, 10340, 11550, 11510
                    , 11530, 11510, 11530, 11510, 11530, 11530)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+10340, netSellCostBuyPrice = netSellCostBuyPrice+11550
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+11510
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+11530
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+11510
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+11530
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+11510
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+11530
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+11530;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 22 and newid=29 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:19:53";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:49:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:49:53', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editprint&id=29'); -- id=1461
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:19:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:49:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:49:57', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1462
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:20:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:50:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:50:08', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1463
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:23:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:53:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:53:36', '1', 'editsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=17'); -- id=1464
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:23:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:53:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:53:46', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=update'); -- id=1465
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 17;
UPDATE sellbill SET  sellbillsysdate = '2026-09-30 20:53:46', userid = '2',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '17';
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 45;
 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 (784, '2026-09-30', 6840, 6460, 6460
                    , 6460, 6460, 6460, 6460
                    , 0, 0, 0, 0
                    , 0, 0, 0,19,0, 6460, 6460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6840, sellCostBuyPrice =sellCostBuyPrice-6460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6460, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6460
                        , returnSellVal = returnSellVal-0, 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-19
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6840, 6460, 6460
                    , 6460, 6460, 6460, 6460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6460, 6460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6840, sellCostBuyPrice =sellCostBuyPrice-6460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6460, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6460
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '34', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('784', '1', '19', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '34', '1', '2026-09-30 16:27:04','0','0'); -- id=1687
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 295.00
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 295
                where sellbilldetailid = 46;
 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 (775, '2026-09-30', 1890, 1770, 1770
                    , 1770, 1770, 1770, 1770
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1890, sellCostBuyPrice =sellCostBuyPrice-1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1770, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1770
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1770
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1770
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1770
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-6
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1890, 1770, 1770
                    , 1770, 1770, 1770, 1770
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1890, sellCostBuyPrice =sellCostBuyPrice-1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1770, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1770
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1770
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1770
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1770
                        , returnSellVal = returnSellVal-0, 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 = '14', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '775';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('775', '1', '6', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '8', '14', '1', '2026-09-30 16:27:04','0','0'); -- id=1688
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 47;
 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 (878, '2026-09-30', 5700, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 5400, 5400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5700, sellCostBuyPrice =sellCostBuyPrice-5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5400
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5700, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5400, 5400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5700, sellCostBuyPrice =sellCostBuyPrice-5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5400
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '878';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('878', '1', '15', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '15', '1', '2026-09-30 16:27:04','0','0'); -- id=1689
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 48;
 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 (1100, '2026-09-30', 5320, 5040, 5040
                    , 5040, 5040, 5040, 5040
                    , 0, 0, 0, 0
                    , 0, 0, 0,14,0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5320, sellCostBuyPrice =sellCostBuyPrice-5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5040
                        , returnSellVal = returnSellVal-0, 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-14
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5320, 5040, 5040
                    , 5040, 5040, 5040, 5040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5320, sellCostBuyPrice =sellCostBuyPrice-5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5040
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '1100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1100', '1', '14', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '20', '1', '2026-09-30 16:27:04','0','0'); -- id=1690
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 49;
 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 (891, '2026-09-30', 6400, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6400, sellCostBuyPrice =sellCostBuyPrice-6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-20
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6400, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6400, sellCostBuyPrice =sellCostBuyPrice-6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '891';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('891', '1', '20', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '10', '30', '1', '2026-09-30 16:27:04','0','0'); -- id=1691
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 310, lastbuyprice_withDiscountAndTax = 310
                where sellbilldetailid = 50;
 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 (1080, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1650, sellCostBuyPrice =sellCostBuyPrice-1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1550
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1650, sellCostBuyPrice =sellCostBuyPrice-1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1550
                        , returnSellVal = returnSellVal-0, 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 = '45', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '1080';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1080', '1', '5', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '40', '45', '1', '2026-09-30 16:27:04','0','0'); -- id=1692
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 38;
UPDATE sellbilldetail SET  lastbuyprice = 535.00 , meanbuyprice = 535.00, lastbuyprice_withDiscount = 535.00, meanbuyprice_withDiscount = 535.00
        , lastbuyprice_withTax = 535, meanbuyprice_withTax = 535, lastbuyprice_withDiscountAndTax = 535
                where sellbilldetailid = 51;
 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 (1346, '2026-09-30', 6660, 6420, 6420
                    , 6420, 6420, 6420, 6420
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 6420, 6420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6660, sellCostBuyPrice =sellCostBuyPrice-6420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6420, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6420
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-12
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6660, 6420, 6420
                    , 6420, 6420, 6420, 6420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6420, 6420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6660, sellCostBuyPrice =sellCostBuyPrice-6420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6420, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6420
                        , returnSellVal = returnSellVal-0, 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 = '36', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '1346';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1346', '1', '12', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '24', '36', '1', '2026-09-30 16:27:04','0','0'); -- id=1693
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 44;
UPDATE sellbilldetail SET  lastbuyprice = 615.00 , meanbuyprice = 615.00, lastbuyprice_withDiscount = 615.00, meanbuyprice_withDiscount = 615.00
        , lastbuyprice_withTax = 615, meanbuyprice_withTax = 615, lastbuyprice_withDiscountAndTax = 615
                where sellbilldetailid = 52;
 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 (1352, '2026-09-30', 11430, 11070, 11070
                    , 11070, 11070, 11070, 11070
                    , 0, 0, 0, 0
                    , 0, 0, 0,18,0, 11070, 11070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-11430, sellCostBuyPrice =sellCostBuyPrice-11070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-11070, sellCostMeanBuyPrice = sellCostMeanBuyPrice-11070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-11070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-11070
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-11070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-11070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-11070
                        , returnSellVal = returnSellVal-0, 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-18
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 11430, 11070, 11070
                    , 11070, 11070, 11070, 11070
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11070, 11070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-11430, sellCostBuyPrice =sellCostBuyPrice-11070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-11070, sellCostMeanBuyPrice = sellCostMeanBuyPrice-11070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-11070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-11070
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-11070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-11070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-11070
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '1352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1352', '1', '18', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '30', '1', '2026-09-30 16:27:04','0','0'); -- id=1694
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 53;
 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 (873, '2026-09-30', 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1800, sellCostBuyPrice =sellCostBuyPrice-1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1700
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1800, sellCostBuyPrice =sellCostBuyPrice-1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1700
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '873';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('873', '1', '5', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '5', '10', '1', '2026-09-30 16:27:04','0','0'); -- id=1695
UPDATE sellbilldetail SET  lastbuyprice = 345.00 , meanbuyprice = 345.00, lastbuyprice_withDiscount = 345.00, meanbuyprice_withDiscount = 345.00
        , lastbuyprice_withTax = 345, meanbuyprice_withTax = 345, lastbuyprice_withDiscountAndTax = 345
                where sellbilldetailid = 54;
 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 (879, '2026-09-30', 1825, 1725, 1725
                    , 1725, 1725, 1725, 1725
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 1725, 1725, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1825, sellCostBuyPrice =sellCostBuyPrice-1725
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1725, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1725
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1725, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1725
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1725
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1725
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1725
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1825, 1725, 1725
                    , 1725, 1725, 1725, 1725
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1725, 1725, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1825, sellCostBuyPrice =sellCostBuyPrice-1725
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1725, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1725
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1725, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1725
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1725
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1725
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1725
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '879';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('879', '1', '5', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '4', '9', '1', '2026-09-30 16:27:04','0','0'); -- id=1696
UPDATE sellbilldetail SET  lastbuyprice = 415.00 , meanbuyprice = 415.00, lastbuyprice_withDiscount = 415.00, meanbuyprice_withDiscount = 415.00
        , lastbuyprice_withTax = 415, meanbuyprice_withTax = 415, lastbuyprice_withDiscountAndTax = 415
                where sellbilldetailid = 55;
 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 (1097, '2026-09-30', 6525, 6225, 6225
                    , 6225, 6225, 6225, 6225
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 6225, 6225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6525, sellCostBuyPrice =sellCostBuyPrice-6225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6225, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6225
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6525, 6225, 6225
                    , 6225, 6225, 6225, 6225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6225, 6225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6525, sellCostBuyPrice =sellCostBuyPrice-6225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6225, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6225
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '1097';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1097', '1', '15', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '15', '30', '1', '2026-09-30 16:27:04','0','0'); -- id=1697
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 37;
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 56;
 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 (1345, '2026-09-30', 3540, 3420, 3420
                    , 3420, 3420, 3420, 3420
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 3420, 3420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3540, sellCostBuyPrice =sellCostBuyPrice-3420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3420, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3420
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-6
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3540, 3420, 3420
                    , 3420, 3420, 3420, 3420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3420, 3420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3540, sellCostBuyPrice =sellCostBuyPrice-3420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3420, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3420
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '1345';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1345', '1', '6', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '18', '24', '1', '2026-09-30 16:27:04','0','0'); -- id=1698
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 57;
 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 (972, '2026-09-30', 9400, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 9000, 9000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9400, sellCostBuyPrice =sellCostBuyPrice-9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-9000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-20
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9400, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9000, 9000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9400, sellCostBuyPrice =sellCostBuyPrice-9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-9000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '75', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '972';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('972', '1', '20', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '55', '75', '1', '2026-09-30 16:27:04','0','0'); -- id=1699
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 58;
 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 (886, '2026-09-30', 5700, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0,15,0, 5400, 5400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5700, sellCostBuyPrice =sellCostBuyPrice-5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5400
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-15
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5700, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5400, 5400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5700, sellCostBuyPrice =sellCostBuyPrice-5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5400
                        , returnSellVal = returnSellVal-0, 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 = '35', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '886';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('886', '1', '15', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '20', '35', '1', '2026-09-30 16:27:04','0','0'); -- id=1700
UPDATE sellbilldetail SET  lastbuyprice = 355.00 , meanbuyprice = 355.00, lastbuyprice_withDiscount = 355.00, meanbuyprice_withDiscount = 355.00
        , lastbuyprice_withTax = 355, meanbuyprice_withTax = 355, lastbuyprice_withDiscountAndTax = 355
                where sellbilldetailid = 59;
 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 (885, '2026-09-30', 1875, 1775, 1775
                    , 1775, 1775, 1775, 1775
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 1775, 1775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1875, sellCostBuyPrice =sellCostBuyPrice-1775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1775, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1775
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-5
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1875, 1775, 1775
                    , 1775, 1775, 1775, 1775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1775, 1775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1875, sellCostBuyPrice =sellCostBuyPrice-1775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1775, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1775
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '85', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '885';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('885', '1', '5', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '80', '85', '1', '2026-09-30 16:27:04','0','0'); -- id=1701
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 60;
 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 (841, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8600
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-20
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-8600
                        , returnSellVal = returnSellVal-0, 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 = '70', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '841';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('841', '1', '20', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '50', '70', '1', '2026-09-30 16:27:04','0','0'); -- id=1702
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-11 where id = 47;
UPDATE sellbilldetail SET  lastbuyprice = 0.00 , meanbuyprice = 0.00, lastbuyprice_withDiscount = 0.00, meanbuyprice_withDiscount = 0.00
        
                where sellbilldetailid = 61;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1355, '2026-09-30', 3840, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3840, 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-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-12
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3840, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3840, 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-0, 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 = '2026-09-30 20:53:46' WHERE storedetailid = '1355';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1355', '1', '12', '0', '17', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '12', '1', '2026-09-30 16:27:04','0','0'); -- id=1703
CALL clientInUse(6,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '6';
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 ('6','0.00','0.00','1','تعديل فاتورة مبيعات','17', '0', '2026-09-30 16:27:04', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '89395', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 16:27:04','0','0','',''); -- id=50
UPDATE client SET  inUse = 0 where clientid = 6;
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '72720',  userid = '1' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('162115','89395', '1', '2', 'تعديل فاتورة مبيعات', '17', '72720', '2026-09-30 20:53:46', '1',  'sellbillController.php','6','','0'); -- id=42
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 89395, 81555, 81555
                    , 81555, 81555, 81555, 81555
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,81555, 81555, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-89395, sellCostBuyPrice =sellCostBuyPrice-81555
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-81555, sellCostMeanBuyPrice = sellCostMeanBuyPrice-81555
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-81555, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-81555
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-81555
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-81555
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-81555
                        , returnSellVal = returnSellVal-0, 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 (6, '2026-09-30', 89395, 81555, 81555
                    , 81555, 81555, 81555, 81555
                    , 0, 0, 0, 0
                    , 0, 0, 0, 81555, 81555, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-89395, sellCostBuyPrice =sellCostBuyPrice-81555
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-81555, sellCostMeanBuyPrice = sellCostMeanBuyPrice-81555
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-81555, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-81555
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-81555
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-81555
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-81555
                        , returnSellVal = returnSellVal-0, 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, 89395, 81555, 81555
                    , 81555, 81555, 81555, 81555, 81555, 81555)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-89395, netSellCostBuyPrice = netSellCostBuyPrice-81555
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-81555
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-81555
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-81555
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-81555
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-81555
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-81555
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-81555;

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


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

COMMIT;
BEGIN;
CALL clientInUse(6,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,shipfrom,shipto,paymethodshipping,whatShippingCost,sellbilltypeclientid,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 16:27:04', '06abd051f1ee02', '6', '0.00', '89395', '0', '1', '89395', '89395', '0', '89395', '1', '2026-09-30 16:27:04', '', '1', '0', 'محل الشاذلي بني سويف', '2', '1', '3', '0', 'الشازلي بني سويف', '212', '17', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-30','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0',''); -- id=30
UPDATE client SET  clientdebt = '89395', userid = '1' WHERE clientid = '6';
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 ('6','0.00','89395','0','اضافة فاتورة مبيعات (معدله)','30', '89395', '2026-09-30 20:53:46', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '89395', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 16:27:04','0','0','',''); -- id=51
UPDATE client SET  inUse = 0 where clientid = 6;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','08354', '30', '13', '784', '19.00', '360', '6840', '0', '', '0', '2026-09-30 20:53:46', '784', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','360','6840','0','','0','0.00','0','0','0','0'); -- id=173
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 173;
 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 (784, '2026-09-30', 6840, 6460, 6460
                    , 6460, 6460, 6460, 6460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 19, 0, 6460, 6460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6840, sellCostBuyPrice =sellCostBuyPrice+6460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6460
                        , returnSellVal = returnSellVal+0, 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+19
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6840, 6460, 6460
                    , 6460, 6460, 6460, 6460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6460, 6460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6840, sellCostBuyPrice =sellCostBuyPrice+6460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '784';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('784', '1', '19', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '34', '15', '1', '2026-09-30 20:53:46','0','0'); -- id=1704
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 ('295','08585', '30', '13', '775', '6.00', '315', '1890', '0', '', '0', '2026-09-30 20:53:46', '775', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','315','1890','0','','0','0.00','0','0','0','0'); -- id=174
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 295.00, meanbuyprice_withDiscount = 295.00
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 295
                where sellbilldetailid = 174;
 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 (775, '2026-09-30', 1890, 1770, 1770
                    , 1770, 1770, 1770, 1770
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1890, sellCostBuyPrice =sellCostBuyPrice+1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1770, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1770
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1770
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1770
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1770
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+6
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1890, 1770, 1770
                    , 1770, 1770, 1770, 1770
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1890, sellCostBuyPrice =sellCostBuyPrice+1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1770, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1770
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1770
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1770
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1770
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '775';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('775', '1', '6', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '14', '8', '1', '2026-09-30 20:53:46','0','0'); -- id=1705
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 ('360','07091', '30', '24', '878', '15.00', '380', '5700', '0', '', '0', '2026-09-30 20:53:46', '878', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','380','5700','0','','0','0.00','0','0','0','0'); -- id=175
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 175;
 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 (878, '2026-09-30', 5700, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 5400, 5400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5700, sellCostBuyPrice =sellCostBuyPrice+5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5700, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5400, 5400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5700, sellCostBuyPrice =sellCostBuyPrice+5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '878';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('878', '1', '15', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '0', '1', '2026-09-30 20:53:46','0','0'); -- id=1706
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 ('360','04732', '30', '38', '1100', '14.00', '380', '5320', '0', '', '0', '2026-09-30 20:53:46', '1100', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','380','5320','0','','0','0.00','0','0','0','0'); -- id=176
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 176;
 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 (1100, '2026-09-30', 5320, 5040, 5040
                    , 5040, 5040, 5040, 5040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 14, 0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5320, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5040
                        , returnSellVal = returnSellVal+0, 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+14
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5320, 5040, 5040
                    , 5040, 5040, 5040, 5040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5320, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '1100';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1100', '1', '14', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '6', '1', '2026-09-30 20:53:46','0','0'); -- id=1707
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 ('300','08562', '30', '25', '891', '20.00', '320', '6400', '0', '', '0', '2026-09-30 20:53:46', '891', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','320','6400','0','','0','0.00','0','0','0','0'); -- id=177
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 177;
 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 (891, '2026-09-30', 6400, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6400, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6400, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6400, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '891';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('891', '1', '20', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '30', '10', '1', '2026-09-30 20:53:46','0','0'); -- id=1708
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 ('310','07114', '30', '36', '1080', '5.00', '330', '1650', '0', '', '0', '2026-09-30 20:53:46', '1080', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','330','1650','0','','0','0.00','0','0','0','0'); -- id=178
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 310, lastbuyprice_withDiscountAndTax = 310
                where sellbilldetailid = 178;
 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 (1080, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1650, 1550, 1550
                    , 1550, 1550, 1550, 1550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1550, 1550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1550
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1550
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1550
                        , returnSellVal = returnSellVal+0, 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 = '40', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '1080';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1080', '1', '5', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '45', '40', '1', '2026-09-30 20:53:46','0','0'); -- id=1709
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 38;
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 ('535','01346', '30', '31', '1346', '12.00', '555', '6660', '0', '', '0', '2026-09-30 20:53:46', '1346', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','38-12,','1','1','0','0','555','6660','0','','0','0.00','0','0','0','0'); -- id=179
UPDATE sellbilldetail SET  lastbuyprice = 535.00 , meanbuyprice = 535.00, lastbuyprice_withDiscount = 535.00, meanbuyprice_withDiscount = 535.00
        , lastbuyprice_withTax = 535, meanbuyprice_withTax = 535, lastbuyprice_withDiscountAndTax = 535
                where sellbilldetailid = 179;
 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 (1346, '2026-09-30', 6660, 6420, 6420
                    , 6420, 6420, 6420, 6420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 6420, 6420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6660, sellCostBuyPrice =sellCostBuyPrice+6420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6660, 6420, 6420
                    , 6420, 6420, 6420, 6420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6420, 6420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6660, sellCostBuyPrice =sellCostBuyPrice+6420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '1346';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1346', '1', '12', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '36', '24', '1', '2026-09-30 20:53:46','0','0'); -- id=1710
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+18 where id = 44;
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 ('615','01352', '30', '31', '1352', '18.00', '635', '11430', '0', '', '0', '2026-09-30 20:53:46', '1352', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','44-18,','1','1','0','0','635','11430','0','','0','0.00','0','0','0','0'); -- id=180
UPDATE sellbilldetail SET  lastbuyprice = 615.00 , meanbuyprice = 615.00, lastbuyprice_withDiscount = 615.00, meanbuyprice_withDiscount = 615.00
        , lastbuyprice_withTax = 615, meanbuyprice_withTax = 615, lastbuyprice_withDiscountAndTax = 615
                where sellbilldetailid = 180;
 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 (1352, '2026-09-30', 11430, 11070, 11070
                    , 11070, 11070, 11070, 11070
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 11070, 11070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11430, sellCostBuyPrice =sellCostBuyPrice+11070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11070, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11070
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11070
                        , returnSellVal = returnSellVal+0, 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+18
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 11430, 11070, 11070
                    , 11070, 11070, 11070, 11070
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11070, 11070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11430, sellCostBuyPrice =sellCostBuyPrice+11070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11070, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11070, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11070
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11070
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11070
                        , returnSellVal = returnSellVal+0, 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 = '2026-09-30 20:53:46' WHERE storedetailid = '1352';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1352', '1', '18', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '30', '12', '1', '2026-09-30 20:53:46','0','0'); -- id=1711
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 ('340','07415', '30', '24', '873', '5.00', '360', '1800', '0', '', '0', '2026-09-30 20:53:46', '873', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','360','1800','0','','0','0.00','0','0','0','0'); -- id=181
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 181;
 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 (873, '2026-09-30', 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '873';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('873', '1', '5', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '10', '5', '1', '2026-09-30 20:53:46','0','0'); -- id=1712
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 ('345','08528', '30', '24', '879', '5.00', '365', '1825', '0', '', '0', '2026-09-30 20:53:46', '879', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','365','1825','0','','0','0.00','0','0','0','0'); -- id=182
UPDATE sellbilldetail SET  lastbuyprice = 345.00 , meanbuyprice = 345.00, lastbuyprice_withDiscount = 345.00, meanbuyprice_withDiscount = 345.00
        , lastbuyprice_withTax = 345, meanbuyprice_withTax = 345, lastbuyprice_withDiscountAndTax = 345
                where sellbilldetailid = 182;
 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 (879, '2026-09-30', 1825, 1725, 1725
                    , 1725, 1725, 1725, 1725
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1725, 1725, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1825, sellCostBuyPrice =sellCostBuyPrice+1725
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1725, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1725
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1725, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1725
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1725
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1725
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1725
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1825, 1725, 1725
                    , 1725, 1725, 1725, 1725
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1725, 1725, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1825, sellCostBuyPrice =sellCostBuyPrice+1725
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1725, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1725
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1725, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1725
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1725
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1725
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1725
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '879';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('879', '1', '5', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '9', '4', '1', '2026-09-30 20:53:46','0','0'); -- id=1713
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('415','08785', '30', '38', '1097', '15.00', '435', '6525', '0', '', '0', '2026-09-30 20:53:46', '1097', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','435','6525','0','','0','0.00','0','0','0','0'); -- id=183
UPDATE sellbilldetail SET  lastbuyprice = 415.00 , meanbuyprice = 415.00, lastbuyprice_withDiscount = 415.00, meanbuyprice_withDiscount = 415.00
        , lastbuyprice_withTax = 415, meanbuyprice_withTax = 415, lastbuyprice_withDiscountAndTax = 415
                where sellbilldetailid = 183;
 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 (1097, '2026-09-30', 6525, 6225, 6225
                    , 6225, 6225, 6225, 6225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 6225, 6225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6525, sellCostBuyPrice =sellCostBuyPrice+6225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6225
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6525, 6225, 6225
                    , 6225, 6225, 6225, 6225
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6225, 6225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6525, sellCostBuyPrice =sellCostBuyPrice+6225
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6225, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6225
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6225, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6225
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6225
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6225
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6225
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '1097';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1097', '1', '15', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '30', '15', '1', '2026-09-30 20:53:46','0','0'); -- id=1714
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 37;
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 ('570','01345', '30', '31', '1345', '6.00', '590', '3540', '0', '', '0', '2026-09-30 20:53:46', '1345', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','37-6,','1','1','0','0','590','3540','0','','0','0.00','0','0','0','0'); -- id=184
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 570.00, meanbuyprice_withDiscount = 570.00
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where sellbilldetailid = 184;
 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 (1345, '2026-09-30', 3540, 3420, 3420
                    , 3420, 3420, 3420, 3420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3420, 3420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3540, sellCostBuyPrice =sellCostBuyPrice+3420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+6
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3540, 3420, 3420
                    , 3420, 3420, 3420, 3420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3420, 3420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3540, sellCostBuyPrice =sellCostBuyPrice+3420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3420
                        , returnSellVal = returnSellVal+0, 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 = '18', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '1345';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1345', '1', '6', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '24', '18', '1', '2026-09-30 20:53:46','0','0'); -- id=1715
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 ('450','07426', '30', '30', '972', '20.00', '470', '9400', '0', '', '0', '2026-09-30 20:53:46', '972', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','470','9400','0','','0','0.00','0','0','0','0'); -- id=185
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 185;
 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 (972, '2026-09-30', 9400, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 9000, 9000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9400, sellCostBuyPrice =sellCostBuyPrice+9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9400, 9000, 9000
                    , 9000, 9000, 9000, 9000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9000, 9000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9400, sellCostBuyPrice =sellCostBuyPrice+9000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '55', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '972';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('972', '1', '20', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '75', '55', '1', '2026-09-30 20:53:46','0','0'); -- id=1716
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 ('360','09633', '30', '24', '886', '15.00', '380', '5700', '0', '', '0', '2026-09-30 20:53:46', '886', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','380','5700','0','','0','0.00','0','0','0','0'); -- id=186
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 186;
 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 (886, '2026-09-30', 5700, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 5400, 5400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5700, sellCostBuyPrice =sellCostBuyPrice+5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 5700, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5400, 5400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5700, sellCostBuyPrice =sellCostBuyPrice+5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '886';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('886', '1', '15', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '35', '20', '1', '2026-09-30 20:53:46','0','0'); -- id=1717
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 ('355','09632', '30', '24', '885', '5.00', '375', '1875', '0', '', '0', '2026-09-30 20:53:46', '885', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','375','1875','0','','0','0.00','0','0','0','0'); -- id=187
UPDATE sellbilldetail SET  lastbuyprice = 355.00 , meanbuyprice = 355.00, lastbuyprice_withDiscount = 355.00, meanbuyprice_withDiscount = 355.00
        , lastbuyprice_withTax = 355, meanbuyprice_withTax = 355, lastbuyprice_withDiscountAndTax = 355
                where sellbilldetailid = 187;
 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 (885, '2026-09-30', 1875, 1775, 1775
                    , 1775, 1775, 1775, 1775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1775, 1775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1875, sellCostBuyPrice =sellCostBuyPrice+1775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1775
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1875, 1775, 1775
                    , 1775, 1775, 1775, 1775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1775, 1775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1875, sellCostBuyPrice =sellCostBuyPrice+1775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1775
                        , returnSellVal = returnSellVal+0, 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 = '80', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '885';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('885', '1', '5', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '85', '80', '1', '2026-09-30 20:53:46','0','0'); -- id=1718
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 ('430','09511', '30', '19', '841', '20.00', '450', '9000', '0', '', '0', '2026-09-30 20:53:46', '841', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','450','9000','0','','0','0.00','0','0','0','0'); -- id=188
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 188;
 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 (841, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 9000, 8600, 8600
                    , 8600, 8600, 8600, 8600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8600, 8600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+8600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8600
                        , returnSellVal = returnSellVal+0, 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 = '50', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '841';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('841', '1', '20', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '70', '50', '1', '2026-09-30 20:53:46','0','0'); -- id=1719
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+11 where id = 47;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('0','07909', '30', '13', '1355', '12.00', '320', '3840', '0', '', '0', '2026-09-30 20:53:46', '1355', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','47-11,','1','1','0','0','320','3840','0','','0','0.00','0','0','0','0'); -- id=189
UPDATE sellbilldetail SET  lastbuyprice = 0.00 , meanbuyprice = 0.00, lastbuyprice_withDiscount = 0.00, meanbuyprice_withDiscount = 0.00
        
                where sellbilldetailid = 189;
 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 (1355, '2026-09-30', 3840, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3840, 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+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 3840, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 0, 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3840, 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+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:53:46' WHERE storedetailid = '1355';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1355', '1', '12', '1', '30', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '12', '0', '1', '2026-09-30 20:53:46','0','0'); -- id=1720
UPDATE dailyentry SET totalcreditor = '89395.00', totaldebtor = '89395.00', thedate = '2026-09-30', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 16:27:04', entryComment = 'اضافة فاتورة مبيعات رقم 17', fromFlag = '1',related='0',isopeningentry='0',operationId='17',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=17' WHERE id = '812';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '89395.00', '89395.00', '2026-09-30', '1', '0', '812', '2026-09-30 20:53:46','تم عكس القيد رقم 812 ','1','0','0','0','0',''); -- id=867
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('867', '498', '89395.00', '','0'); -- id=867
UPDATE accountstree SET name = 'محل الشاذلي بني سويف', customName = 'محل الشاذلي بني سويف', customNameEn = 'بني سويف', nameEn = 'بني سويف', parent = '58', accountNature = '0', theValue = '-89395', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 20:39:57' WHERE id = '498';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('867', '143', '89395.00', '','0'); -- id=868
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '291155', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
UPDATE dailyentry SET totalcreditor = '89395.00', totaldebtor = '89395.00', thedate = '2026-09-30', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 16:27:04', entryComment = 'اضافة فاتورة مبيعات رقم 17 - تحصيل الفاتورة من العميل', fromFlag = '1',related='0',isopeningentry='0',operationId='17',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=17' WHERE id = '813';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '89395.00', '89395.00', '2026-09-30', '1', '0', '813', '2026-09-30 20:53:46','تم عكس القيد رقم 813 ','1','0','0','0','0',''); -- id=868
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('868', '419', '89395.00', '','0'); -- id=868
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '72720', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('868', '498', '89395.00', '','0'); -- id=869
UPDATE accountstree SET name = 'محل الشاذلي بني سويف', customName = 'محل الشاذلي بني سويف', customNameEn = 'بني سويف', nameEn = 'بني سويف', parent = '58', accountNature = '0', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 20:39:57' WHERE id = '498';
UPDATE dailyentry SET totalcreditor = '81555.00', totaldebtor = '81555.00', thedate = '2026-09-30', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 16:27:04', entryComment = 'اضافة فاتورة مبيعات رقم 17 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='17',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=17' WHERE id = '814';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '81555.00', '81555.00', '2026-09-30', '1', '0', '814', '2026-09-30 20:53:46','تم عكس القيد رقم 814 ','1','0','0','0','0',''); -- id=869
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('869', '402', '81555.00', '','0'); -- id=869
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '289151.9', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('869', '382', '81555.00', '','0'); -- id=870
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12710133.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '89395', '89395', '2026-09-30', '1', '0', '0', '2026-09-30 20:53:46','اضافة فاتورة مبيعات رقم 30','1','0',null,'0','30','sellbillController.php?do=showDetail&sellbillid=30'); -- id=870
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('870', '498', '89395', '','0'); -- id=871
UPDATE accountstree SET name = 'محل الشاذلي بني سويف', customName = 'محل الشاذلي بني سويف', customNameEn = 'بني سويف', nameEn = 'بني سويف', parent = '58', accountNature = '0', theValue = '89395', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 20:39:57' WHERE id = '498';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('870', '143', '89395', '','0'); -- id=870
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '380550', 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 ( '81555', '81555', '2026-09-30', '1', '0', '0', '2026-09-30 20:53:46','اضافة فاتورة مبيعات رقم 30 - صرف البضاعة من المخزن','1','0',null,'0','30','sellbillController.php?do=showDetail&sellbillid=30'); -- id=871
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('871', '402', '81555', '','0'); -- id=872
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '370706.9', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('871', '382', '81555', '','0'); -- id=871
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12628578.1', 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='870,0,871' 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 ('2026-09-30', 89395, 81555, 81555
                    , 81555, 81555, 81555, 81555
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,81555, 81555, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+89395, sellCostBuyPrice =sellCostBuyPrice+81555
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+81555, sellCostMeanBuyPrice = sellCostMeanBuyPrice+81555
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+81555, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+81555
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+81555
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+81555
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+81555
                        , returnSellVal = returnSellVal+0, 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 (6, '2026-09-30', 89395, 81555, 81555
                    , 81555, 81555, 81555, 81555
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,81555, 81555, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+89395, sellCostBuyPrice =sellCostBuyPrice+81555
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+81555, sellCostMeanBuyPrice = sellCostMeanBuyPrice+81555
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+81555, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+81555
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+81555
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+81555
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+81555
                        , returnSellVal = returnSellVal+0, 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, 89395, 81555, 81555
                    , 81555, 81555, 81555, 81555, 81555, 81555)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+89395, netSellCostBuyPrice = netSellCostBuyPrice+81555
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+81555
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+81555
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+81555
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+81555
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+81555
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+81555
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+81555;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 17 and newid=30 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:23:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:53:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:53:46', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editprint&id=30'); -- id=1466
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:23:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:53:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:53:50', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1467
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:23:52";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:53:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:53:52', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1468
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:24:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:54:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:54:22', '1', 'editsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=24'); -- id=1469
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:24:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:54:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:54:40', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=update'); -- id=1470
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 24;
UPDATE sellbill SET  sellbillsysdate = '2026-09-30 20:54:40', userid = '2',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '24';
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 119;
 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 (1137, '2026-09-30', 1000, 920, 920
                    , 920, 920, 920, 920
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 920, 920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1000, sellCostBuyPrice =sellCostBuyPrice-920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-920, sellCostMeanBuyPrice = sellCostMeanBuyPrice-920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-920
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-4
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1000, 920, 920
                    , 920, 920, 920, 920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 920, 920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1000, sellCostBuyPrice =sellCostBuyPrice-920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-920, sellCostMeanBuyPrice = sellCostMeanBuyPrice-920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-920
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2026-09-30 20:54:40' WHERE storedetailid = '1137';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1137', '1', '4', '0', '24', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '4', '1', '2026-09-30 18:33:45','0','0'); -- id=1721
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 120;
 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 (1141, '2026-09-30', 2160, 2000, 2000
                    , 2000, 2000, 2000, 2000
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2160, sellCostBuyPrice =sellCostBuyPrice-2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-8
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2160, 2000, 2000
                    , 2000, 2000, 2000, 2000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2160, sellCostBuyPrice =sellCostBuyPrice-2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2026-09-30 20:54:40' WHERE storedetailid = '1141';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1141', '1', '8', '0', '24', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '8', '1', '2026-09-30 18:33:45','0','0'); -- id=1722
UPDATE sellbilldetail SET  lastbuyprice = 265.00 , meanbuyprice = 265.00, lastbuyprice_withDiscount = 265.00, meanbuyprice_withDiscount = 265.00
        , lastbuyprice_withTax = 265, meanbuyprice_withTax = 265, lastbuyprice_withDiscountAndTax = 265
                where sellbilldetailid = 121;
 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 (1144, '2026-09-30', 2280, 2120, 2120
                    , 2120, 2120, 2120, 2120
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 2120, 2120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2280, sellCostBuyPrice =sellCostBuyPrice-2120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2120, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2120
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-8
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2280, 2120, 2120
                    , 2120, 2120, 2120, 2120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2120, 2120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2280, sellCostBuyPrice =sellCostBuyPrice-2120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2120, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2120
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2026-09-30 20:54:40' WHERE storedetailid = '1144';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1144', '1', '8', '0', '24', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '8', '1', '2026-09-30 18:33:45','0','0'); -- id=1723
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-33 where id = 46;
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 188.64, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 188.64
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 188.64, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 122;
 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 (1247, '2026-09-30', 6600, 6270, 6270
                    , 6225.12, 6270, 6225.12, 6270
                    , 0, 0, 0, 0
                    , 0, 0, 0,33,0, 6270, 6225.12, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6600, sellCostBuyPrice =sellCostBuyPrice-6270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6225.12
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6225.12
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6225.12
                        , returnSellVal = returnSellVal-0, 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-33
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6600, 6270, 6270
                    , 6225.12, 6270, 6225.12, 6270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6270, 6225.12, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6600, sellCostBuyPrice =sellCostBuyPrice-6270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6270, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6225.12
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6225.12
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6225.12
                        , returnSellVal = returnSellVal-0, 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 = '99', userid = '1', storedetaildate = '2026-09-30 20:54:40' WHERE storedetailid = '1247';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1247', '1', '33', '0', '24', 'تعديل فاتورة مبيعات', 'sellbillController.php', '66', '99', '1', '2026-09-30 18:33:45','0','0'); -- id=1724
UPDATE sellbilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 370.00, meanbuyprice_withDiscount = 370.00
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 370
                where sellbilldetailid = 123;
 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 (1215, '2026-09-30', 7020, 6660, 6660
                    , 6660, 6660, 6660, 6660
                    , 0, 0, 0, 0
                    , 0, 0, 0,18,0, 6660, 6660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7020, sellCostBuyPrice =sellCostBuyPrice-6660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6660, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6660
                        , returnSellVal = returnSellVal-0, 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-18
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7020, 6660, 6660
                    , 6660, 6660, 6660, 6660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6660, 6660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7020, sellCostBuyPrice =sellCostBuyPrice-6660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6660, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-6660
                        , returnSellVal = returnSellVal-0, 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 = '36', userid = '1', storedetaildate = '2026-09-30 20:54:40' WHERE storedetailid = '1215';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1215', '1', '18', '0', '24', 'تعديل فاتورة مبيعات', 'sellbillController.php', '18', '36', '1', '2026-09-30 18:33:45','0','0'); -- id=1725
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-43 where id = 46;
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 188.64, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 188.64
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 188.64, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 124;
 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 (1247, '2026-09-30', 11200, 10640, 10640
                    , 10563.84, 10640, 10563.84, 10640
                    , 0, 0, 0, 0
                    , 0, 0, 0,56,0, 10640, 10563.84, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-11200, sellCostBuyPrice =sellCostBuyPrice-10640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-10640, sellCostMeanBuyPrice = sellCostMeanBuyPrice-10563.84
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-10640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-10563.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-10640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-10640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-10563.84
                        , returnSellVal = returnSellVal-0, 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-56
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 11200, 10640, 10640
                    , 10563.84, 10640, 10563.84, 10640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10640, 10563.84, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-11200, sellCostBuyPrice =sellCostBuyPrice-10640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-10640, sellCostMeanBuyPrice = sellCostMeanBuyPrice-10563.84
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-10640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-10563.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-10640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-10640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-10563.84
                        , returnSellVal = returnSellVal-0, 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 = '155', userid = '1', storedetaildate = '2026-09-30 20:54:40' WHERE storedetailid = '1247';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1247', '1', '56', '0', '24', 'تعديل فاتورة مبيعات', 'sellbillController.php', '99', '155', '1', '2026-09-30 18:33:45','0','0'); -- id=1726
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.00','1','تعديل فاتورة مبيعات','24', '0', '2026-09-30 18:33:45', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '30260', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 18:33:45','0','0','',''); -- id=52
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '42460',  userid = '1' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('72720','30260', '1', '2', 'تعديل فاتورة مبيعات', '24', '42460', '2026-09-30 20:54:40', '1',  'sellbillController.php','1','','0'); -- id=43
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-09-30', 30260, 28610, 28610
                    , 28488.96, 28610, 28488.96, 28610
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,28610, 28488.96, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-30260, sellCostBuyPrice =sellCostBuyPrice-28610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-28610, sellCostMeanBuyPrice = sellCostMeanBuyPrice-28488.96
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-28610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-28488.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-28610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-28610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-28488.96
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 30260, 28610, 28610
                    , 28488.96, 28610, 28488.96, 28610
                    , 0, 0, 0, 0
                    , 0, 0, 0, 28610, 28488.96, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-30260, sellCostBuyPrice =sellCostBuyPrice-28610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-28610, sellCostMeanBuyPrice = sellCostMeanBuyPrice-28488.96
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-28610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-28488.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-28610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-28610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-28488.96
                        , returnSellVal = returnSellVal-0, 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, 30260, 28610, 28610
                    , 28488.96, 28610, 28488.96, 28610, 28610, 28488.96)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-30260, netSellCostBuyPrice = netSellCostBuyPrice-28610
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-28610
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-28488.96
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-28610
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-28488.96
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-28610
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-28610
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-28488.96;

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


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

COMMIT;
BEGIN;
CALL clientInUse(3,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,shipfrom,shipto,paymethodshipping,whatShippingCost,sellbilltypeclientid,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-09-30 18:33:45', '06abd28ca5a6b5', '3', '38955.00', '69215', '0', '1', '30260', '30260', '0', '30260', '1', '2026-09-30 18:33:45', '', '1', '0', 'محل الفيوم عروض', '2', '1', '3', '0', 'محل الفيوم عروض', '127', '24', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-09-30','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','0','0','0',''); -- id=31
UPDATE client SET  clientdebt = '69215', userid = '1' WHERE clientid = '3';
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 ('3','38955.00','30260','0','اضافة فاتورة مبيعات (معدله)','31', '69215', '2026-09-30 20:54:40', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '30260', '0', null, '0', null, null,'', '0','1','1','0','1','2026-09-30 18:33:45','0','0','',''); -- id=53
UPDATE client SET  inUse = 0 where clientid = 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 ('230','05645', '31', '42', '1137', '4.00', '250', '1000', '0', '', '0', '2026-09-30 20:54:40', '1137', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','250','1000','0','','0','0.00','0','0','0','0'); -- id=190
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 190;
 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 (1137, '2026-09-30', 1000, 920, 920
                    , 920, 920, 920, 920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 920, 920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 1000, 920, 920
                    , 920, 920, 920, 920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 920, 920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:54:40' WHERE storedetailid = '1137';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1137', '1', '4', '1', '31', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4', '0', '1', '2026-09-30 20:54:40','0','0'); -- id=1727
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','06700', '31', '42', '1141', '8.00', '270', '2160', '0', '', '0', '2026-09-30 20:54:40', '1141', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','270','2160','0','','0','0.00','0','0','0','0'); -- id=191
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 191;
 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 (1141, '2026-09-30', 2160, 2000, 2000
                    , 2000, 2000, 2000, 2000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2160, 2000, 2000
                    , 2000, 2000, 2000, 2000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:54:40' WHERE storedetailid = '1141';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1141', '1', '8', '1', '31', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '0', '1', '2026-09-30 20:54:40','0','0'); -- id=1728
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 ('265','07835', '31', '42', '1144', '8.00', '285', '2280', '0', '', '0', '2026-09-30 20:54:40', '1144', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','285','2280','0','','0','0.00','0','0','0','0'); -- id=192
UPDATE sellbilldetail SET  lastbuyprice = 265.00 , meanbuyprice = 265.00, lastbuyprice_withDiscount = 265.00, meanbuyprice_withDiscount = 265.00
        , lastbuyprice_withTax = 265, meanbuyprice_withTax = 265, lastbuyprice_withDiscountAndTax = 265
                where sellbilldetailid = 192;
 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 (1144, '2026-09-30', 2280, 2120, 2120
                    , 2120, 2120, 2120, 2120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2120, 2120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2280, sellCostBuyPrice =sellCostBuyPrice+2120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 2280, 2120, 2120
                    , 2120, 2120, 2120, 2120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2120, 2120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2280, sellCostBuyPrice =sellCostBuyPrice+2120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-09-30 20:54:40' WHERE storedetailid = '1144';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1144', '1', '8', '1', '31', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '8', '0', '1', '2026-09-30 20:54:40','0','0'); -- id=1729
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+33 where id = 46;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','09745', '31', '71', '1247', '33.00', '200', '6600', '0', '', '0', '2026-09-30 20:54:40', '1247', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','46-33,','1','1','0','0','200','6600','0','','0','0.00','0','0','0','0'); -- id=193
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 188.64, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 188.64
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 188.64, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 193;
 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 (1247, '2026-09-30', 6600, 6270, 6270
                    , 6225.12, 6270, 6225.12, 6270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 33, 0, 6270, 6225.12, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6600, sellCostBuyPrice =sellCostBuyPrice+6270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6225.12
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6225.12
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6225.12
                        , returnSellVal = returnSellVal+0, 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+33
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 6600, 6270, 6270
                    , 6225.12, 6270, 6225.12, 6270
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6270, 6225.12, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6600, sellCostBuyPrice =sellCostBuyPrice+6270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6225.12
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6225.12
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6270
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6270
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6225.12
                        , returnSellVal = returnSellVal+0, 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 = '122', userid = '1', storedetaildate = '2026-09-30 20:54:40' WHERE storedetailid = '1247';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1247', '1', '33', '1', '31', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '155', '122', '1', '2026-09-30 20:54:40','0','0'); -- id=1730
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 ('370','09274', '31', '62', '1215', '18.00', '390', '7020', '0', '', '0', '2026-09-30 20:54:40', '1215', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','390','7020','0','','0','0.00','0','0','0','0'); -- id=194
UPDATE sellbilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 370.00, meanbuyprice_withDiscount = 370.00
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 370
                where sellbilldetailid = 194;
 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 (1215, '2026-09-30', 7020, 6660, 6660
                    , 6660, 6660, 6660, 6660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 6660, 6660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7020, sellCostBuyPrice =sellCostBuyPrice+6660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6660
                        , returnSellVal = returnSellVal+0, 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+18
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 7020, 6660, 6660
                    , 6660, 6660, 6660, 6660
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6660, 6660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7020, sellCostBuyPrice =sellCostBuyPrice+6660
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6660
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6660
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6660
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6660
                        , returnSellVal = returnSellVal+0, 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 = '18', userid = '1', storedetaildate = '2026-09-30 20:54:40' WHERE storedetailid = '1215';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1215', '1', '18', '1', '31', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '36', '18', '1', '2026-09-30 20:54:40','0','0'); -- id=1731
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+43 where id = 46;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','09745', '31', '71', '1247', '56.00', '200', '11200', '0', '', '0', '2026-09-30 20:54:40', '1247', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','46-43,','1','1','0','0','200','11200','0','','0','0.00','0','0','0','0'); -- id=195
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 188.64, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 188.64
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 188.64, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 195;
 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 (1247, '2026-09-30', 11200, 10640, 10640
                    , 10563.84, 10640, 10563.84, 10640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 56, 0, 10640, 10563.84, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11200, sellCostBuyPrice =sellCostBuyPrice+10640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10563.84
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10563.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10563.84
                        , returnSellVal = returnSellVal+0, 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+56
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-09-30', 11200, 10640, 10640
                    , 10563.84, 10640, 10563.84, 10640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10640, 10563.84, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11200, sellCostBuyPrice =sellCostBuyPrice+10640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10563.84
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10563.84
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10563.84
                        , returnSellVal = returnSellVal+0, 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 = '66', userid = '1', storedetaildate = '2026-09-30 20:54:40' WHERE storedetailid = '1247';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1247', '1', '56', '1', '31', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '122', '66', '1', '2026-09-30 20:54:40','0','0'); -- id=1732
UPDATE dailyentry SET totalcreditor = '30260.00', totaldebtor = '30260.00', thedate = '2026-09-30', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 18:33:45', entryComment = 'اضافة فاتورة مبيعات رقم 24', fromFlag = '1',related='0',isopeningentry='0',operationId='24',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=24' WHERE id = '847';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30260.00', '30260.00', '2026-09-30', '1', '0', '847', '2026-09-30 20:54:40','تم عكس القيد رقم 847 ','1','0','0','0','0',''); -- id=872
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('872', '419', '30260.00', '','0'); -- id=872
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '42460', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('872', '143', '30260.00', '','0'); -- id=873
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '350290', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
UPDATE dailyentry SET totalcreditor = '28610.00', totaldebtor = '28610.00', thedate = '2026-09-30', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-09-30 18:33:45', entryComment = 'اضافة فاتورة مبيعات رقم 24 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='24',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=24' WHERE id = '848';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '28610.00', '28610.00', '2026-09-30', '1', '0', '848', '2026-09-30 20:54:40','تم عكس القيد رقم 848 ','1','0','0','0','0',''); -- id=873
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('873', '402', '28610.00', '','0'); -- id=873
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '342096.9', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('873', '382', '28610.00', '','0'); -- id=874
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12657188.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30260', '30260', '2026-09-30', '1', '0', '0', '2026-09-30 20:54:40','اضافة فاتورة مبيعات رقم 31','1','0',null,'0','31','sellbillController.php?do=showDetail&sellbillid=31'); -- id=874
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('874', '495', '30260', '','0'); -- id=875
UPDATE accountstree SET name = 'محل الفيوم عروض', customName = 'محل الفيوم عروض', customNameEn = 'محل الفيوم عروض', nameEn = 'محل الفيوم عروض', parent = '58', accountNature = '0', theValue = '69215', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '2', del = '0', sysdate = '2026-09-30 15:30:47' WHERE id = '495';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('874', '143', '30260', '','0'); -- id=874
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '380550', 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 ( '28610', '28610', '2026-09-30', '1', '0', '0', '2026-09-30 20:54:40','اضافة فاتورة مبيعات رقم 31 - صرف البضاعة من المخزن','1','0',null,'0','31','sellbillController.php?do=showDetail&sellbillid=31'); -- id=875
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('875', '402', '28610', '','0'); -- id=876
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '370706.9', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('875', '382', '28610', '','0'); -- id=875
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '12628578.1', 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='874,0,875' 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 ('2026-09-30', 30260, 28610, 28610
                    , 28488.96, 28610, 28488.96, 28610
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,28610, 28488.96, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30260, sellCostBuyPrice =sellCostBuyPrice+28610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+28610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+28488.96
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+28610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+28488.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+28610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+28610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28488.96
                        , returnSellVal = returnSellVal+0, 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 (3, '2026-09-30', 30260, 28610, 28610
                    , 28488.96, 28610, 28488.96, 28610
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,28610, 28488.96, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+30260, sellCostBuyPrice =sellCostBuyPrice+28610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+28610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+28488.96
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+28610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+28488.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+28610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+28610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+28488.96
                        , returnSellVal = returnSellVal+0, 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, 30260, 28610, 28610
                    , 28488.96, 28610, 28488.96, 28610, 28610, 28488.96)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+30260, netSellCostBuyPrice = netSellCostBuyPrice+28610
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+28610
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+28488.96
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+28610
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+28488.96
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+28610
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+28610
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+28488.96;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 24 and newid=31 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:24:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:54:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:54:40', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editprint&id=31'); -- id=1471
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:24:44";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:54:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:54:44', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1472
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:24:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:54:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:54:45', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1473
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:26:58";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:56:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:56:58', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1474
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 17:27:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 20:57:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-09-30 20:57:04', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=1475
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 18:03:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 21:33:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-09-30 21:33:47', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=1476
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 18:03:47";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-09-30 21:33:47', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=1477
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 18:03:53";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 21:33:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-09-30 21:33:53', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/usergroupController.php'); -- id=1478
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 18:04:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 21:34:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('userController.php', '2026-09-30 21:34:03', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/userController.php'); -- id=1479
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 18:05:35";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 21:35:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('saveController.php', '2026-09-30 21:35:35', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/saveController.php'); -- id=1480
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 18:05:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 21:35:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('saveController.php', '2026-09-30 21:35:47', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/saveController.php?do=add'); -- id=1481
BEGIN;
INSERT INTO save (savename, savecurrentvalue, savedetails, savedate, conditions, userid, currencyId, sortby,treeId,saveTreeParentType,webApiId,savetypeid) VALUES ('خزينه المحل الارضي', '', '', '2026-09-30 21:35:47', '0', '1', '1', '0','0','0','0','0'); -- id=3
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('0','0', '0', '3', 'تم اضافة  خزنة باسم   [ خزينه المحل الارضي ] ', '3', '0', '2026-09-30 21:35:47', '1',  'saveController.php','0','','0'); -- id=44
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('خزينه المحل الارضي', 'خزينه المحل الارضي', 'خزينه المحل الارضي', 'خزينه المحل الارضي', '40', '0', '0', '0', '', '1', '1', '', '0', '3', '1', '', '1', '0', '2026-09-30 21:35:47'); -- id=501
UPDATE save SET savename = 'خزينه المحل الارضي', savecurrentvalue = '', savedetails = '', savedate = '2026-09-30 21:35:47', conditions = '0', userid = '1', sortby= '0',treeId='501',saveTreeParentType='0',savetypeid='0' WHERE saveid = '3';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 18:05:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 21:35:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('saveController.php', '2026-09-30 21:35:47', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/saveController.php?do=sucess'); -- id=1482
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 18:05:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 21:35:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('saveController.php', '2026-09-30 21:35:48', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/saveController.php?do=show'); -- id=1483
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 18:06:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 21:36:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('userController.php', '2026-09-30 21:36:13', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/userController.php'); -- id=1484
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 18:07:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 21:37:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('userController.php', '2026-09-30 21:37:39', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/userController.php?do=add'); -- id=1485
INSERT INTO user (username, password, usergroupid, employeename, currentdate, conditions, saveid,userstoreid ,awardrate,searchinonesave, branchId,question, answer,blockedByLimits,directSaveBills,userstoreidDef,empid,obygyDoctorId,lang,viewclients,viewbills,storeSupervisor,storeSupervisorStores,projectids,bankids,saveids,searchinonestorebalance,storeids,webApiId,closeSavid,charityids,laterNakdiUserIds,awardrategomla,awardratehalf,dellaternakdipayed,accountids) VALUES ('محمود', '246', '3', 'محمود', '2026-09-30', '0', '3', '2' ,'0' ,'1','-1','ما اسمك','ما اسمك','0','0','2','0','0','','0','0','0','','-1,','-1,','3','0','2','0','3','-1,','-1,-1','0','0','1','-1,'); -- id=4
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 18:07:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 21:37:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('userController.php', '2026-09-30 21:37:39', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/userController.php?do=sucess'); -- id=1486
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-09-30 18:07:41";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-09-30 21:37:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('userController.php', '2026-09-30 21:37:41', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/userController.php?do=show'); -- id=1487
