UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 00:46:30";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 04:45:37";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 04:45:37";
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-10-11',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='',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-10-12 04:45:40";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 08:15:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 08:15:40', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7366
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-10-12',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='',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-10-12 04:45:40";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 08:15:40', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7367
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:18:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 08:48:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 08:48:12', '2', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7368
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:18:12";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 08:48:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 08:48:12', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7369
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:18:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 08:48:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 08:48:33', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7370
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-10-12 05:21:57";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 08:51:57", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 08:51:57', '3', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7371
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:21:57";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 08:51:57', '3', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7372
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:22:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 08:52:02", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 08:52:02', '3', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7373
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:22:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 08:52:03", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 08:52:03', '3', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7374
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:40:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:10:58", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 09:10:58', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7375

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acc74b18c6d7
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 09:10:58', '06acc74b18c6d7', '1', '0.00', '0', '0', '1', '13200.00', '13200', '13200', '0', '1', '2026-10-12 09:10:58', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '24' ,'0','','','','','-1','0','0','0','0','0','13200','0','','0','0','13200','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=407
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','اضافة فاتورة مبيعات','407', '0', '2026-10-12 09:10:58', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '13200', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 09:10:58','0','0','',''); -- id=538
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 673;
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 ('470','01759', '407', '136', '1759', '12', '510', '6120', '0', '', '0', '2026-10-12 09:10:58', '1759', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','673-12,','1','1','0','0','510','6120','0','','0','0.00','0','0','0','0'); -- id=1474
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 470.00, meanbuyprice_withDiscount = 470.00
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 470
                where sellbilldetailid = 1474;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1759, '2026-10-12', 6120, 5640, 5640
                    , 5640, 5640, 5640, 5640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 5640, 5640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6120, sellCostBuyPrice =sellCostBuyPrice+5640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 6120, 5640, 5640
                    , 5640, 5640, 5640, 5640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5640, 5640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6120, sellCostBuyPrice =sellCostBuyPrice+5640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 09:10:58' WHERE storedetailid = '2772';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1759', '1', '12', '1', '407', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '20', '2', '2026-10-12 09:10:58','0','0'); -- id=4581
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 678;
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 ('550','01764', '407', '137', '1764', '12', '590', '7080', '0', '', '0', '2026-10-12 09:10:58', '1764', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','678-12,','1','1','0','0','590','7080','0','','0','0.00','0','0','0','0'); -- id=1475
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 550.00, meanbuyprice_withDiscount = 550.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 550
                where sellbilldetailid = 1475;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1764, '2026-10-12', 7080, 6600, 6600
                    , 6600, 6600, 6600, 6600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 6600, 6600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7080, sellCostBuyPrice =sellCostBuyPrice+6600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 7080, 6600, 6600
                    , 6600, 6600, 6600, 6600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6600, 6600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7080, sellCostBuyPrice =sellCostBuyPrice+6600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-12 09:10:58' WHERE storedetailid = '2777';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1764', '1', '12', '1', '407', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '36', '2', '2026-10-12 09:10:58','0','0'); -- id=4582
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2372765',  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 ('2359565','13200', '0', '2', 'اضافة فاتورة مبيعات', '407', '2372765', '2026-10-12 09:10:58', '2',  'sellbillController.php','1','','0'); -- id=511
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '13200', '13200', '2026-10-12', '2', '0', '0', '2026-10-12 09:10:58','اضافة فاتورة مبيعات رقم 407','1','0',null,'0','407','sellbillController.php?do=showDetail&sellbillid=407'); -- id=2048
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2048', '419', '13200', '','0'); -- id=2088
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2372765', 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 ('2048', '143', '13200', '','0'); -- id=2050
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4148755', 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 ( '12240', '12240', '2026-10-12', '2', '0', '0', '2026-10-12 09:10:58','اضافة فاتورة مبيعات رقم 407 - صرف البضاعة من المخزن','1','0',null,'0','407','sellbillController.php?do=showDetail&sellbillid=407'); -- id=2049
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2049', '402', '12240', '','0'); -- id=2089
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3879417.97', 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 ('2049', '382', '12240', '','0'); -- id=2051
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19617134.73', 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='2048,0,2049' where sellbillid=407;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 13200, 12240, 12240
                    , 12240, 12240, 12240, 12240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,12240, 12240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+13200, sellCostBuyPrice =sellCostBuyPrice+12240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+12240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+12240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 13200, 12240, 12240
                    , 12240, 12240, 12240, 12240
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,12240, 12240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+13200, sellCostBuyPrice =sellCostBuyPrice+12240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+12240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+12240
                        , returnSellVal = returnSellVal+0, 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, 13200, 12240, 12240
                    , 12240, 12240, 12240, 12240, 12240, 12240)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+13200, netSellCostBuyPrice = netSellCostBuyPrice+12240
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+12240
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+12240
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+12240
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+12240
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+12240
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+12240
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+12240;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acc74b18c6d7 and sellbillId = 407 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:40:59";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:10:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 09:10:59', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7376
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:44:09";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:44:09";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:44:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:14:12", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 09:14:12', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7377
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:44:13";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 09:14:13", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 09:14:13', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7378
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:44:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:14:17", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 09:14:17', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7379
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 05:44:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:14:20", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 09:14:20', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7380
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:02:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:32:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 09:32:51', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7381
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:03:27";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:33:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 09:33:27', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7382
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:04:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:34:07", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 09:34:07', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7383
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:04:09";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:34:09", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 09:34:09', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7384
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:04:14";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:34:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 09:34:14', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7385
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:04:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:34:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 09:34:31', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7386
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:05:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:35:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 09:35:42', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7387
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:06:34";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:36:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 09:36:34', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7388
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:12:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:42:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 09:42:41', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=7389
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 ('ويد ليج lc الاسباني','','48','360','360','360','360','2026-10-12','0','1','0','','0','0','0','0','0','360','360','360','360','360','0','0','0','0','.','0','0','0','360','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','360','360','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','360','0','0','0','0','0','0','','','0','0','0','0'); -- id=1828
UPDATE product SET productName = 'ويد ليج lc الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '360', productSellAllPrice = '360', productSellUnitPrice = '360', productSellHalfPrice = '360', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01828',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1828';
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', '1828', '1', '2026-10-12', '1', '0','0182801','360','360','360','360','','0','0','0','0','0','0','0','0','0','0'); -- id=1828
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1828', '1', '0', '1', '2026-10-12'); -- id=2843
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1828', '1', '0', '0', '1828', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4583
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1828, 1,'2026-10-12 09:42:41',1)
                ON DUPLICATE KEY UPDATE productid = 1828, edited = 1, sysdate = '2026-10-12 09:42:41', userid = 1; -- id=2750
UPDATE product SET productName = 'ويد ليج lc الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01828',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1828';
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 ('موديل 1234 الاسباني','','48','350','350','350','350','2026-10-12','0','1','0','','0','0','0','0','0','350','350','350','350','350','0','0','0','0','.','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','1','0','0','0','0','0','0','','350','0','0','0','0','0','0','','','0','0','0','0'); -- id=1829
UPDATE product SET productName = 'موديل 1234 الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350', productSellAllPrice = '350', productSellUnitPrice = '350', productSellHalfPrice = '350', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01829',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 = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '1829';
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', '1829', '1', '2026-10-12', '1', '0','0182901','350','350','350','350','','0','0','0','0','0','0','0','0','0','0'); -- id=1829
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1829', '1', '0', '1', '2026-10-12'); -- id=2844
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1829', '1', '0', '0', '1829', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4584
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1829, 1,'2026-10-12 09:42:41',1)
                ON DUPLICATE KEY UPDATE productid = 1829, edited = 1, sysdate = '2026-10-12 09:42:41', userid = 1; -- id=2751
UPDATE product SET productName = 'موديل 1234 الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01829',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 = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '1829';
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 ('موديل im الاسباني','','48','350','350','350','350','2026-10-12','0','1','0','','0','0','0','0','0','350','350','350','350','350','0','0','0','0','.','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','1','0','0','0','0','0','0','','350','0','0','0','0','0','0','','','0','0','0','0'); -- id=1830
UPDATE product SET productName = 'موديل im الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350', productSellAllPrice = '350', productSellUnitPrice = '350', productSellHalfPrice = '350', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01830',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 = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '1830';
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', '1830', '1', '2026-10-12', '1', '0','0183001','350','350','350','350','','0','0','0','0','0','0','0','0','0','0'); -- id=1830
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1830', '1', '0', '1', '2026-10-12'); -- id=2845
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1830', '1', '0', '0', '1830', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4585
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1830, 1,'2026-10-12 09:42:41',1)
                ON DUPLICATE KEY UPDATE productid = 1830, edited = 1, sysdate = '2026-10-12 09:42:41', userid = 1; -- id=2752
UPDATE product SET productName = 'موديل im الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01830',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 = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '1830';
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 ('موديل run الاسباني','','48','350','350','350','350','2026-10-12','0','1','0','','0','0','0','0','0','350','350','350','350','350','0','0','0','0','.','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','1','0','0','0','0','0','0','','350','0','0','0','0','0','0','','','0','0','0','0'); -- id=1831
UPDATE product SET productName = 'موديل run الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350', productSellAllPrice = '350', productSellUnitPrice = '350', productSellHalfPrice = '350', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01831',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 = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '1831';
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', '1831', '1', '2026-10-12', '1', '0','0183101','350','350','350','350','','0','0','0','0','0','0','0','0','0','0'); -- id=1831
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1831', '1', '0', '1', '2026-10-12'); -- id=2846
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1831', '1', '0', '0', '1831', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4586
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1831, 1,'2026-10-12 09:42:41',1)
                ON DUPLICATE KEY UPDATE productid = 1831, edited = 1, sysdate = '2026-10-12 09:42:41', userid = 1; -- id=2753
UPDATE product SET productName = 'موديل run الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01831',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 = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '1831';
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 ('موديل qa  ويد ليج الاسباني','','48','360','360','360','360','2026-10-12','0','1','0','','0','0','0','0','0','360','360','360','360','360','0','0','0','0','.','0','0','0','360','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','360','360','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','360','0','0','0','0','0','0','','','0','0','0','0'); -- id=1832
UPDATE product SET productName = 'موديل qa  ويد ليج الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '360', productSellAllPrice = '360', productSellUnitPrice = '360', productSellHalfPrice = '360', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01832',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1832';
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', '1832', '1', '2026-10-12', '1', '0','0183201','360','360','360','360','','0','0','0','0','0','0','0','0','0','0'); -- id=1832
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1832', '1', '0', '1', '2026-10-12'); -- id=2847
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1832', '1', '0', '0', '1832', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4587
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1832, 1,'2026-10-12 09:42:41',1)
                ON DUPLICATE KEY UPDATE productid = 1832, edited = 1, sysdate = '2026-10-12 09:42:41', userid = 1; -- id=2754
UPDATE product SET productName = 'موديل qa  ويد ليج الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01832',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1832';
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 ('موديل حزام الاسباني','','48','370','370','370','370','2026-10-12','0','1','0','','0','0','0','0','0','370','370','370','370','370','0','0','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=1833
UPDATE product SET productName = 'موديل حزام الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '370', productSellAllPrice = '370', productSellUnitPrice = '370', productSellHalfPrice = '370', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01833',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 = '0' , 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 = '1833';
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', '1833', '1', '2026-10-12', '1', '0','0183301','370','370','370','370','','0','0','0','0','0','0','0','0','0','0'); -- id=1833
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1833', '1', '0', '1', '2026-10-12'); -- id=2848
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1833', '1', '0', '0', '1833', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4588
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1833, 1,'2026-10-12 09:42:41',1)
                ON DUPLICATE KEY UPDATE productid = 1833, edited = 1, sysdate = '2026-10-12 09:42:41', userid = 1; -- id=2755
UPDATE product SET productName = 'موديل حزام الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01833',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 = '0' , 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 = '1833';
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 ('موديل بدله الاسباني','','48','900','900','900','900','2026-10-12','0','1','0','','0','0','0','0','0','900','900','900','900','900','0','0','0','0','.','0','0','0','900','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','900','900','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','900','0','0','0','0','0','0','','','0','0','0','0'); -- id=1834
UPDATE product SET productName = 'موديل بدله الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '900', productSellAllPrice = '900', productSellUnitPrice = '900', productSellHalfPrice = '900', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01834',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '900',meanbuyprice = '900',meanbuyprice_withDiscount = '900' , productbuypricereal = '900' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',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='900',meanbuyprice_withTax='900',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='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1834';
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', '1834', '1', '2026-10-12', '1', '0','0183401','900','900','900','900','','0','0','0','0','0','0','0','0','0','0'); -- id=1834
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1834', '1', '0', '1', '2026-10-12'); -- id=2849
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1834', '1', '0', '0', '1834', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4589
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1834, 1,'2026-10-12 09:42:41',1)
                ON DUPLICATE KEY UPDATE productid = 1834, edited = 1, sysdate = '2026-10-12 09:42:41', userid = 1; -- id=2756
UPDATE product SET productName = 'موديل بدله الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '900.00', productSellAllPrice = '900.00', productSellUnitPrice = '900.00', productSellHalfPrice = '900.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01834',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '900',meanbuyprice = '900',meanbuyprice_withDiscount = '900' , productbuypricereal = '900' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',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='900',meanbuyprice_withTax='900',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='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1834';
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 ('موديل بدله دبل الاسباني ','','48','900','900','900','900','2026-10-12','0','1','0','','0','0','0','0','0','900','900','900','900','900','0','0','0','0','.','0','0','0','900','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','900','900','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','900','0','0','0','0','0','0','','','0','0','0','0'); -- id=1835
UPDATE product SET productName = 'موديل بدله دبل الاسباني ', productDescription = '', productCatId = '48', productBuyPrice = '900', productSellAllPrice = '900', productSellUnitPrice = '900', productSellHalfPrice = '900', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01835',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '900',meanbuyprice = '900',meanbuyprice_withDiscount = '900' , productbuypricereal = '900' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',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='900',meanbuyprice_withTax='900',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='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1835';
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', '1835', '1', '2026-10-12', '1', '0','0183501','900','900','900','900','','0','0','0','0','0','0','0','0','0','0'); -- id=1835
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1835', '1', '0', '1', '2026-10-12'); -- id=2850
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1835', '1', '0', '0', '1835', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4590
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1835, 1,'2026-10-12 09:42:41',1)
                ON DUPLICATE KEY UPDATE productid = 1835, edited = 1, sysdate = '2026-10-12 09:42:41', userid = 1; -- id=2757
UPDATE product SET productName = 'موديل بدله دبل الاسباني ', productDescription = '', productCatId = '48', productBuyPrice = '900.00', productSellAllPrice = '900.00', productSellUnitPrice = '900.00', productSellHalfPrice = '900.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01835',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '900',meanbuyprice = '900',meanbuyprice_withDiscount = '900' , productbuypricereal = '900' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',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='900',meanbuyprice_withTax='900',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='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1835';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:12:43";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:42:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 09:42:43', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7390
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:12:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:42:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 09:42:45', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7391
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:16:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:46:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 09:46:16', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7392

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acc79f347074
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 09:46:16', '06acc79f347074', '1', '0.00', '0', '0', '1', '1460.00', '1460', '1460', '0', '1', '2026-10-12 09:46:16', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1460','0','','0','0','1460','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=408
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','اضافة فاتورة مبيعات','408', '0', '2026-10-12 09:46:16', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1460', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 09:46:16','0','0','',''); -- id=539
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 156;
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 ('364.99','01406', '408', '99', '1406', '4', '365', '1460', '0', '', '0', '2026-10-12 09:46:16', '1406', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','156-4,','1','1','0','0','365','1460','0','','0','0.00','0','0','0','0'); -- id=1476
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 365.00, lastbuyprice_withDiscount = 364.99, meanbuyprice_withDiscount = 364.99
        , lastbuyprice_withTax = 365, meanbuyprice_withTax = 365, lastbuyprice_withDiscountAndTax = 364.99
                where sellbilldetailid = 1476;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1406, '2026-10-12', 1460, 1460, 1460
                    , 1460, 1459.96, 1459.96, 1459.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1460, 1460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1460, sellCostBuyPrice =sellCostBuyPrice+1460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1459.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1459.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1459.96
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1460, 1460, 1460
                    , 1460, 1459.96, 1459.96, 1459.96
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1460, 1460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1460, sellCostBuyPrice =sellCostBuyPrice+1460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1459.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1459.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1459.96
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '92', userid = '2', storedetaildate = '2026-10-12 09:46:16' WHERE storedetailid = '1419';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1406', '1', '4', '1', '408', 'اضافة فاتورة مبيعات', 'sellbillController.php', '96', '92', '2', '2026-10-12 09:46:16','0','0'); -- id=4591
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2374225',  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 ('2372765','1460', '0', '2', 'اضافة فاتورة مبيعات', '408', '2374225', '2026-10-12 09:46:16', '2',  'sellbillController.php','1','','0'); -- id=512
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1460', '1460', '2026-10-12', '2', '0', '0', '2026-10-12 09:46:16','اضافة فاتورة مبيعات رقم 408','1','0',null,'0','408','sellbillController.php?do=showDetail&sellbillid=408'); -- id=2050
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2050', '419', '1460', '','0'); -- id=2090
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2374225', 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 ('2050', '143', '1460', '','0'); -- id=2052
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4150215', 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 ( '1459.96', '1459.96', '2026-10-12', '2', '0', '0', '2026-10-12 09:46:16','اضافة فاتورة مبيعات رقم 408 - صرف البضاعة من المخزن','1','0',null,'0','408','sellbillController.php?do=showDetail&sellbillid=408'); -- id=2051
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2051', '402', '1459.96', '','0'); -- id=2091
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3880877.93', 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 ('2051', '382', '1459.96', '','0'); -- id=2053
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19615674.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='2050,0,2051' where sellbillid=408;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 1460, 1460, 1460
                    , 1460, 1459.96, 1459.96, 1459.96
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1460, 1460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1460, sellCostBuyPrice =sellCostBuyPrice+1460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1459.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1459.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1459.96
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 1460, 1460, 1460
                    , 1460, 1459.96, 1459.96, 1459.96
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1460, 1460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1460, sellCostBuyPrice =sellCostBuyPrice+1460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1459.96, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1459.96
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1459.96
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1460
                        , returnSellVal = returnSellVal+0, 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, 1460, 1460, 1460
                    , 1460, 1459.96, 1459.96, 1459.96, 1460, 1460)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1460, netSellCostBuyPrice = netSellCostBuyPrice+1460
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1460
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1460
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1459.96
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1459.96
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1459.96
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1460
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1460;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acc79f347074 and sellbillId = 408 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:16:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:46:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 09:46:16', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7393
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:17:04";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:47:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 09:47:04', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=7394
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 ('06acc8165867f5', '2026-10-12 09:42:45', '11', '119638.00', '206326', '20', '1', '108360.00',  '86688.00', '0', '86688', '1', '2026-10-12 09:47:04', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=103
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 ('01828', '103', '48', '1828', '33', '360', '11880.00', '0', '', '2026-10-12 09:47:04', '1828','','','0','0','0','0','0',null,'360','11880','0','0','0','0','0','0','0','0','1'); -- id=660
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1828, 0, 0
                    , 288, 33, 0, 0, 1, '2026-10-12 09:47:04')
                ON DUPLICATE KEY UPDATE buyprice = 288,
                        buyQuantity =buyQuantity+33, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 09:47:04' ; -- id=853
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1828', '360', '33', '0', 'buyBillController.php', '660', '', '0', '0'); -- id=519
UPDATE product SET  productBuyPrice = "360" WHERE productId = 1828 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 660 ;
UPDATE product SET productName = 'ويد ليج lc الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01828',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '288',meanbuyprice = '360',meanbuyprice_withDiscount = '288' , productbuypricereal = '360.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='360',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='360',meanbuyprice_withTax='360',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='288',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1828';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 288, meanbuyprice_withDiscount = 288
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 288
                where buybilldetailid = 660;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 1828;
UPDATE storedetail SET  productquantity = '33', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2843';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1828', '1', '33', '0', '103', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '33', '1', '2026-10-12 09:42:45','0','0'); -- id=4592
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 ('01829', '103', '48', '1829', '30', '350', '10500.00', '0', '', '2026-10-12 09:47:04', '1829','','','0','0','0','0','0',null,'350','10500','0','0','0','0','0','0','0','0','1'); -- id=661
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1829, 0, 0
                    , 280, 30, 0, 0, 1, '2026-10-12 09:47:04')
                ON DUPLICATE KEY UPDATE buyprice = 280,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 09:47:04' ; -- id=854
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1829', '350', '30', '0', 'buyBillController.php', '661', '', '0', '0'); -- id=520
UPDATE product SET  productBuyPrice = "350" WHERE productId = 1829 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 661 ;
UPDATE product SET productName = 'موديل 1234 الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01829',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '280',meanbuyprice = '350',meanbuyprice_withDiscount = '280' , productbuypricereal = '350.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='350',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='350',meanbuyprice_withTax='350',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='280',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1829';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 280, meanbuyprice_withDiscount = 280
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 280
                where buybilldetailid = 661;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1829;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2844';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1829', '1', '30', '0', '103', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-12 09:42:45','0','0'); -- id=4593
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 ('01830', '103', '48', '1830', '36', '350', '12600.00', '0', '', '2026-10-12 09:47:04', '1830','','','0','0','0','0','0',null,'350','12600','0','0','0','0','0','0','0','0','1'); -- id=662
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1830, 0, 0
                    , 280, 36, 0, 0, 1, '2026-10-12 09:47:04')
                ON DUPLICATE KEY UPDATE buyprice = 280,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 09:47:04' ; -- id=855
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1830', '350', '36', '0', 'buyBillController.php', '662', '', '0', '0'); -- id=521
UPDATE product SET  productBuyPrice = "350" WHERE productId = 1830 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 662 ;
UPDATE product SET productName = 'موديل im الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01830',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '280',meanbuyprice = '350',meanbuyprice_withDiscount = '280' , productbuypricereal = '350.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='350',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='350',meanbuyprice_withTax='350',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='280',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1830';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 280, meanbuyprice_withDiscount = 280
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 280
                where buybilldetailid = 662;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1830;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2845';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1830', '1', '36', '0', '103', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '1', '2026-10-12 09:42:45','0','0'); -- id=4594
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 ('01831', '103', '48', '1831', '30', '350', '10500.00', '0', '', '2026-10-12 09:47:04', '1831','','','0','0','0','0','0',null,'350','10500','0','0','0','0','0','0','0','0','1'); -- id=663
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1831, 0, 0
                    , 280, 30, 0, 0, 1, '2026-10-12 09:47:04')
                ON DUPLICATE KEY UPDATE buyprice = 280,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 09:47:04' ; -- id=856
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1831', '350', '30', '0', 'buyBillController.php', '663', '', '0', '0'); -- id=522
UPDATE product SET  productBuyPrice = "350" WHERE productId = 1831 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 663 ;
UPDATE product SET productName = 'موديل run الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01831',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '280',meanbuyprice = '350',meanbuyprice_withDiscount = '280' , productbuypricereal = '350.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='350',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='350',meanbuyprice_withTax='350',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='280',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1831';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 280, meanbuyprice_withDiscount = 280
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 280
                where buybilldetailid = 663;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1831;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2846';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1831', '1', '30', '0', '103', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-12 09:42:45','0','0'); -- id=4595
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 ('01832', '103', '48', '1832', '30', '360', '10800.00', '0', '', '2026-10-12 09:47:04', '1832','','','0','0','0','0','0',null,'360','10800','0','0','0','0','0','0','0','0','1'); -- id=664
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1832, 0, 0
                    , 288, 30, 0, 0, 1, '2026-10-12 09:47:04')
                ON DUPLICATE KEY UPDATE buyprice = 288,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 09:47:04' ; -- id=857
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1832', '360', '30', '0', 'buyBillController.php', '664', '', '0', '0'); -- id=523
UPDATE product SET  productBuyPrice = "360" WHERE productId = 1832 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 664 ;
UPDATE product SET productName = 'موديل qa  ويد ليج الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01832',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '288',meanbuyprice = '360',meanbuyprice_withDiscount = '288' , productbuypricereal = '360.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='360',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='360',meanbuyprice_withTax='360',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='288',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1832';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 288, meanbuyprice_withDiscount = 288
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 288
                where buybilldetailid = 664;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 1832;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2847';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1832', '1', '30', '0', '103', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-12 09:42:45','0','0'); -- id=4596
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 ('01833', '103', '48', '1833', '24', '370', '8880.00', '0', '', '2026-10-12 09:47:04', '1833','','','0','0','0','0','0',null,'370','8880','0','0','0','0','0','0','0','0','1'); -- id=665
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1833, 0, 0
                    , 296, 24, 0, 0, 1, '2026-10-12 09:47:04')
                ON DUPLICATE KEY UPDATE buyprice = 296,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 09:47:04' ; -- id=858
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1833', '370', '24', '0', 'buyBillController.php', '665', '', '0', '0'); -- id=524
UPDATE product SET  productBuyPrice = "370" WHERE productId = 1833 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 665 ;
UPDATE product SET productName = 'موديل حزام الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01833',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '296',meanbuyprice = '370',meanbuyprice_withDiscount = '296' , productbuypricereal = '370.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='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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='296',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1833';
UPDATE buybilldetail SET  lastbuyprice = 370 , meanbuyprice = 370, lastbuyprice_withDiscount = 296, meanbuyprice_withDiscount = 296
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 296
                where buybilldetailid = 665;
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 1833;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2848';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1833', '1', '24', '0', '103', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 09:42:45','0','0'); -- id=4597
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 ('01834', '103', '48', '1834', '24', '900', '21600.00', '0', '', '2026-10-12 09:47:04', '1834','','','0','0','0','0','0',null,'900','21600','0','0','0','0','0','0','0','0','1'); -- id=666
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1834, 0, 0
                    , 720, 24, 0, 0, 1, '2026-10-12 09:47:04')
                ON DUPLICATE KEY UPDATE buyprice = 720,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 09:47:04' ; -- id=859
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1834', '900', '24', '0', 'buyBillController.php', '666', '', '0', '0'); -- id=525
UPDATE product SET  productBuyPrice = "900" WHERE productId = 1834 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 666 ;
UPDATE product SET productName = 'موديل بدله الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '900.00', productSellAllPrice = '900.00', productSellUnitPrice = '900.00', productSellHalfPrice = '900.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01834',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '720',meanbuyprice = '900',meanbuyprice_withDiscount = '720' , productbuypricereal = '900.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='900',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='900',meanbuyprice_withTax='900',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='720',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1834';
UPDATE buybilldetail SET  lastbuyprice = 900 , meanbuyprice = 900, lastbuyprice_withDiscount = 720, meanbuyprice_withDiscount = 720
        , lastbuyprice_withTax = 900, meanbuyprice_withTax = 900, lastbuyprice_withDiscountAndTax = 720
                where buybilldetailid = 666;
UPDATE productunit SET proUnitBuyPrice  = 900 * productnumber WHERE productid = 1834;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2849';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1834', '1', '24', '0', '103', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 09:42:45','0','0'); -- id=4598
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 ('01835', '103', '48', '1835', '24', '900', '21600.00', '0', '', '2026-10-12 09:47:04', '1835','','','0','0','0','0','0',null,'900','21600','0','0','0','0','0','0','0','0','1'); -- id=667
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1835, 0, 0
                    , 720, 24, 0, 0, 1, '2026-10-12 09:47:04')
                ON DUPLICATE KEY UPDATE buyprice = 720,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 09:47:04' ; -- id=860
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1835', '900', '24', '0', 'buyBillController.php', '667', '', '0', '0'); -- id=526
UPDATE product SET  productBuyPrice = "900" WHERE productId = 1835 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 667 ;
UPDATE product SET productName = 'موديل بدله دبل الاسباني ', productDescription = '', productCatId = '48', productBuyPrice = '900.00', productSellAllPrice = '900.00', productSellUnitPrice = '900.00', productSellHalfPrice = '900.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01835',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '720',meanbuyprice = '900',meanbuyprice_withDiscount = '720' , productbuypricereal = '900.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='900',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='900',meanbuyprice_withTax='900',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='720',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1835';
UPDATE buybilldetail SET  lastbuyprice = 900 , meanbuyprice = 900, lastbuyprice_withDiscount = 720, meanbuyprice_withDiscount = 720
        , lastbuyprice_withTax = 900, meanbuyprice_withTax = 900, lastbuyprice_withDiscountAndTax = 720
                where buybilldetailid = 667;
UPDATE productunit SET proUnitBuyPrice  = 900 * productnumber WHERE productid = 1835;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2850';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1835', '1', '24', '0', '103', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 09:42:45','0','0'); -- id=4599
UPDATE supplier SET  suppliercurrentDebt = '206326',suppliercurrentDebtInCurrency= '206326' , userid = '1', supplierdate = '2026-10-12 09:47:04'   WHERE supplierid = '11';
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 ('11', '119638.00', '86688', '0', 'اضافة فاتورة مشتريات', '103', '206326', '2026-10-12 09:42:45', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','86688','1','119638','86688','206326','0',''); -- id=371
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '86688', '86688', '2026-10-12', '1', '0', '0', '2026-10-12 09:47:04','اضافة فاتورة مشتريات رقم 103','1','0',null,'0','103','buyBillController.php?do=details&id=103'); -- id=2052
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2052', '382', '86688', '','0'); -- id=2092
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19702362.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2052', '430', '86688', '','0'); -- id=2054
UPDATE accountstree SET name = 'الاسباني - مورد', customName = 'الاسباني - مورد', customNameEn = 'الاسباني - مورد', nameEn = 'الاسباني - مورد', parent = '81', accountNature = '1', theValue = '67398', 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 = '430';
update buybill set dailyentryid='2052,0' where buybillid=103;
COMMIT;
UPDATE product SET overAllAveragePrice = 288 WHERE productId = 1828;UPDATE product SET overAllAveragePrice = 280 WHERE productId = 1829;UPDATE product SET overAllAveragePrice = 280 WHERE productId = 1830;UPDATE product SET overAllAveragePrice = 280 WHERE productId = 1831;UPDATE product SET overAllAveragePrice = 288 WHERE productId = 1832;UPDATE product SET overAllAveragePrice = 296 WHERE productId = 1833;UPDATE product SET overAllAveragePrice = 720 WHERE productId = 1834;UPDATE product SET overAllAveragePrice = 720 WHERE productId = 1835;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:17:05";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:47:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 09:47:05', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=103'); -- id=7395
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:17:14";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:47:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 09:47:14', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=103&type=2'); -- id=7396
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:24:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:54:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 09:54:28', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=103&type=2'); -- id=7397
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:24:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:54:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 09:54:31', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=103'); -- id=7398
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:24:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:54:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 09:54:45', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7399
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:24:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 09:54:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 09:54:51', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7400
UPDATE user SET loginip = "" WHERE userid = 6;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:51:46";
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-10-12 06:52:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:22:12", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 10:22:12', '4', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7401
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:52:13";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 10:22:13", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 10:22:13', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7402
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:52:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:22:17", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 10:22:17', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7403
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:54:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:24:12", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 10:24:12', '4', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7404

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acc8aa91ef1e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 10:24:12', '06acc8aa91ef1e', '1', '0.00', '0', '0', '1', '1650.00', '1650', '1650', '0', '2', '2026-10-12 10:24:12', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1650','0','','0','0','1650','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=409
UPDATE client SET  clientdebt = '0', userid = '4' 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','اضافة فاتورة مبيعات','409', '0', '2026-10-12 10:24:12', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1650', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 10:24:12','0','0','',''); -- id=540
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 621;
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 ('495','01722', '409', '49', '1722', '3', '550', '1650', '0', '', '0', '2026-10-12 10:24:12', '1722', '0.00', '0', '2','0.00','','','0','0','0','0','0','0','0','0','','621-3,','1','1','0','0','550','1650','0','','0','0.00','0','0','0','0'); -- id=1477
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 1477;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1722, '2026-10-12', 1650, 1650, 1650
                    , 1650, 1485, 1485, 1485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1485
                            , 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+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 (2, '2026-10-12', 1650, 1650, 1650
                    , 1650, 1485, 1485, 1485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1485
                            , 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 = '33', userid = '4', storedetaildate = '2026-10-12 10:24:12' WHERE storedetailid = '2735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1722', '2', '3', '1', '409', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '33', '4', '2026-10-12 10:24:12','0','0'); -- id=4600
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '488050',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('486400','1650', '0', '3', 'اضافة فاتورة مبيعات', '409', '488050', '2026-10-12 10:24:12', '4',  'sellbillController.php','1','','0'); -- id=513
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1650', '1650', '2026-10-12', '4', '0', '0', '2026-10-12 10:24:12','اضافة فاتورة مبيعات رقم 409','1','0',null,'0','409','sellbillController.php?do=showDetail&sellbillid=409'); -- id=2053
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2053', '501', '1650', '','0'); -- id=2093
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '488050', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2053', '143', '1650', '','0'); -- id=2055
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4151865', 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 ( '1485', '1485', '2026-10-12', '4', '0', '0', '2026-10-12 10:24:12','اضافة فاتورة مبيعات رقم 409 - صرف البضاعة من المخزن','1','0',null,'0','409','sellbillController.php?do=showDetail&sellbillid=409'); -- id=2054
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2054', '402', '1485', '','0'); -- id=2094
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3882362.93', 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 ('2054', '492', '1485', '','0'); -- id=2056
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1120005', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='2053,0,2054' where sellbillid=409;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 1650, 1650, 1650
                    , 1650, 1485, 1485, 1485
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1485
                            , 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;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 1650, 1650, 1650
                    , 1650, 1485, 1485, 1485
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1485
                            , 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1650, 1650, 1650
                    , 1650, 1485, 1485, 1485, 1650, 1650)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1650, netSellCostBuyPrice = netSellCostBuyPrice+1650
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1650
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1650
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1485
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1485
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1485
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1650
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1650;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acc8aa91ef1e and sellbillId = 409 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:54:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:24:12", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 10:24:12', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7405
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:59:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:29:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 10:29:38', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7406

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acc8238b64bc
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 10:29:38', '06acc8238b64bc', '1', '0.00', '0', '50', '1', '13410.00', '13360', '13360', '0', '1', '2026-10-12 10:29:38', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '30' ,'0','','','','','-1','0','0','0','0','0','13360','0','','0','0','13360','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=410
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','اضافة فاتورة مبيعات','410', '0', '2026-10-12 10:29:38', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '13360', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 10:29:38','0','0','',''); -- id=541
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 761;
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 ('410','01787', '410', '138', '1787', '6', '440', '2640', '0', '', '0', '2026-10-12 10:29:38', '1787', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','761-6,','1','1','0','0','440','2640','0','','0','0.00','0','0','0','0'); -- id=1478
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 1478;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1787, '2026-10-12', 2630.1565995526, 2460, 2460
                    , 2460, 2460, 2460, 2460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2630.1565995526, sellCostBuyPrice =sellCostBuyPrice+2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2630.1565995526, 2460, 2460
                    , 2460, 2460, 2460, 2460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2630.1565995526, sellCostBuyPrice =sellCostBuyPrice+2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '2', storedetaildate = '2026-10-12 10:29:38' WHERE storedetailid = '2800';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1787', '1', '6', '1', '410', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '21', '2', '2026-10-12 10:29:38','0','0'); -- id=4601
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 759;
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 ('400','01785', '410', '138', '1785', '6', '430', '2580', '0', '', '0', '2026-10-12 10:29:38', '1785', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','759-6,','1','1','0','0','430','2580','0','','0','0.00','0','0','0','0'); -- id=1479
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 1479;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1785, '2026-10-12', 2570.3803131991, 2400, 2400
                    , 2400, 2400, 2400, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2570.3803131991, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2570.3803131991, 2400, 2400
                    , 2400, 2400, 2400, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2570.3803131991, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 10:29:38' WHERE storedetailid = '2798';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1785', '1', '6', '1', '410', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '6', '2', '2026-10-12 10:29:38','0','0'); -- id=4602
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 522;
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 ('460','01673', '410', '124', '1673', '6', '500', '3000', '0', '', '0', '2026-10-12 10:29:38', '1673', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','522-6,','1','1','0','0','500','3000','0','','0','0.00','0','0','0','0'); -- id=1480
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 460.00, meanbuyprice_withDiscount = 460.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 460
                where sellbilldetailid = 1480;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1673, '2026-10-12', 2988.8143176734, 3000, 3000
                    , 3000, 2760, 2760, 2760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2988.8143176734, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2760
                            , 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+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-10-12', 2988.8143176734, 3000, 3000
                    , 3000, 2760, 2760, 2760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2988.8143176734, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2760
                            , 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 = '24', userid = '2', storedetaildate = '2026-10-12 10:29:38' WHERE storedetailid = '2685';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1673', '1', '6', '1', '410', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '24', '2', '2026-10-12 10:29:38','0','0'); -- id=4603
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 559;
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 ('386.4','01695', '410', '127', '1695', '9', '420', '3780', '0', '', '0', '2026-10-12 10:29:38', '1695', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','559-9,','1','1','0','0','420','3780','0','','0','0.00','0','0','0','0'); -- id=1481
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 386.40, meanbuyprice_withDiscount = 386.40
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 386.4
                where sellbilldetailid = 1481;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1695, '2026-10-12', 3765.9060402685, 3780, 3780
                    , 3780, 3477.6, 3477.6, 3477.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3780, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3765.9060402685, sellCostBuyPrice =sellCostBuyPrice+3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3477.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3477.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3477.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 3765.9060402685, 3780, 3780
                    , 3780, 3477.6, 3477.6, 3477.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3780, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3765.9060402685, sellCostBuyPrice =sellCostBuyPrice+3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3477.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3477.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3477.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '117', userid = '2', storedetaildate = '2026-10-12 10:29:38' WHERE storedetailid = '2707';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1695', '1', '9', '1', '410', 'اضافة فاتورة مبيعات', 'sellbillController.php', '126', '117', '2', '2026-10-12 10:29:38','0','0'); -- id=4604
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 571;
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 ('432.4','01708', '410', '128', '1708', '3', '470', '1410', '0', '', '0', '2026-10-12 10:29:38', '1708', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','571-3,','1','1','0','0','470','1410','0','','0','0.00','0','0','0','0'); -- id=1482
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 432.40, meanbuyprice_withDiscount = 451.20
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 432.4
                where sellbilldetailid = 1482;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1708, '2026-10-12', 1404.7427293065, 1410, 1410
                    , 1410, 1297.2, 1353.6, 1297.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1410, 705, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1404.7427293065, sellCostBuyPrice =sellCostBuyPrice+1410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1297.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1353.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1297.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1410
                            , 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-10-12', 1404.7427293065, 1410, 1410
                    , 1410, 1297.2, 1353.6, 1297.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1410, 705, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1404.7427293065, sellCostBuyPrice =sellCostBuyPrice+1410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1297.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1353.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1297.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1410
                            , 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 = '18', userid = '2', storedetaildate = '2026-10-12 10:29:38' WHERE storedetailid = '2720';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1708', '1', '3', '1', '410', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '18', '2', '2026-10-12 10:29:38','0','0'); -- id=4605
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2387585',  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 ('2374225','13360', '0', '2', 'اضافة فاتورة مبيعات', '410', '2387585', '2026-10-12 10:29:38', '2',  'sellbillController.php','1','','0'); -- id=514
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '13410', '13410', '2026-10-12', '2', '0', '0', '2026-10-12 10:29:38','اضافة فاتورة مبيعات رقم 410','1','0',null,'0','410','sellbillController.php?do=showDetail&sellbillid=410'); -- id=2055
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2055', '419', '13360', '','0'); -- id=2095
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2387585', 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 ('2055', '398', '50', '','0'); -- id=2096
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '464645', theOrder = '0', layingOrder = '51', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-08-08 17:58:26' WHERE id = '398';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2055', '143', '13410', '','0'); -- id=2057
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4165275', 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 ( '12394.8', '12394.8', '2026-10-12', '2', '0', '0', '2026-10-12 10:29:38','اضافة فاتورة مبيعات رقم 410 - صرف البضاعة من المخزن','1','0',null,'0','410','sellbillController.php?do=showDetail&sellbillid=410'); -- id=2056
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2056', '402', '12394.8', '','0'); -- id=2097
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3894757.73', 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 ('2056', '382', '12394.8', '','0'); -- id=2058
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19689967.97', 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='2055,0,2056' where sellbillid=410;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 13360, 13050, 13050
                    , 13050, 12394.8, 12451.2, 12394.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,13050, 12345, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+13360, sellCostBuyPrice =sellCostBuyPrice+13050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12394.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12451.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12394.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+12345
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 13360, 13050, 13050
                    , 13050, 12394.8, 12451.2, 12394.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,13050, 12345, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+13360, sellCostBuyPrice =sellCostBuyPrice+13050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12394.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12451.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12394.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+12345
                        , returnSellVal = returnSellVal+0, 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, 13360, 13050, 13050
                    , 13050, 12394.8, 12451.2, 12394.8, 13050, 12345)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+13360, netSellCostBuyPrice = netSellCostBuyPrice+13050
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+13050
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+13050
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+12394.8
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+12451.2
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+12394.8
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+13050
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+12345;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acc8238b64bc and sellbillId = 410 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:59:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:29:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 10:29:38', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7407
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:59:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:29:49", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 10:29:49', '4', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7408

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acc8b1cc7a06
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 10:29:49', '06acc8b1cc7a06', '1', '0.00', '0', '0', '1', '4200.00', '4200', '4200', '0', '2', '2026-10-12 10:29:49', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '15' ,'0','','','','','-1','0','0','0','0','0','4200','0','','0','0','4200','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=411
UPDATE client SET  clientdebt = '0', userid = '4' 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','اضافة فاتورة مبيعات','411', '0', '2026-10-12 10:29:49', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4200', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 10:29:49','0','0','',''); -- id=542
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 780;
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 ('252','01779', '411', '99', '1779', '15', '280', '4200', '0', '', '0', '2026-10-12 10:29:49', '1779', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','780-15,','1','1','0','0','280','4200','0','','0','0.00','0','0','0','0'); -- id=1483
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.00, lastbuyprice_withDiscount = 252.00, meanbuyprice_withDiscount = 252.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 252
                where sellbilldetailid = 1483;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1779, '2026-10-12', 4200, 4200, 4200
                    , 4200, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 4200, 4200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (2, '2026-10-12', 4200, 4200, 4200
                    , 4200, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4200, 4200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '4', storedetaildate = '2026-10-12 10:29:49' WHERE storedetailid = '2810';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1779', '2', '15', '1', '411', 'اضافة فاتورة مبيعات', 'sellbillController.php', '35', '20', '4', '2026-10-12 10:29:49','0','0'); -- id=4606
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '492250',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('488050','4200', '0', '3', 'اضافة فاتورة مبيعات', '411', '492250', '2026-10-12 10:29:49', '4',  'sellbillController.php','1','','0'); -- id=515
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4200', '4200', '2026-10-12', '4', '0', '0', '2026-10-12 10:29:49','اضافة فاتورة مبيعات رقم 411','1','0',null,'0','411','sellbillController.php?do=showDetail&sellbillid=411'); -- id=2057
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2057', '501', '4200', '','0'); -- id=2098
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '492250', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2057', '143', '4200', '','0'); -- id=2059
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4169475', 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 ( '3780', '3780', '2026-10-12', '4', '0', '0', '2026-10-12 10:29:49','اضافة فاتورة مبيعات رقم 411 - صرف البضاعة من المخزن','1','0',null,'0','411','sellbillController.php?do=showDetail&sellbillid=411'); -- id=2058
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2058', '402', '3780', '','0'); -- id=2099
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3898537.73', 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 ('2058', '492', '3780', '','0'); -- id=2060
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1116225', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='2057,0,2058' where sellbillid=411;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 4200, 4200, 4200
                    , 4200, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4200, 4200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 4200, 4200, 4200
                    , 4200, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4200, 4200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4200
                        , returnSellVal = returnSellVal+0, 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, 4200, 4200, 4200
                    , 4200, 3780, 3780, 3780, 4200, 4200)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4200, netSellCostBuyPrice = netSellCostBuyPrice+4200
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4200
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4200
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3780
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3780
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3780
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4200
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4200;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acc8b1cc7a06 and sellbillId = 411 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 06:59:50";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:29:50", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 10:29:50', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7409
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:09:10";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:09:10";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:09:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:39:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 10:39:13', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7410
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:09:14";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 10:39:14', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7411
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:09:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:39:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 10:39:16', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7412
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:09:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:39:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 10:39:22', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7413
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:10:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:40:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 10:40:31', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7414
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:10:59";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:40:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 10:40:59', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7415
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:11:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:41:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 10:41:13', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7416
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:12:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:42:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 10:42:02', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7417
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:12:15";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:12:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:42:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 10:42:17', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7418
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:12:17";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 10:42:17', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7419
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:28:59";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:28:59";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:29:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:59:02", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 10:59:02', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7420
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:29:02";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 10:59:02", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 10:59:02', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7421
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:29:04";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:59:04", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 10:59:04', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7422
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:29:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:59:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 10:59:15', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7423
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:29:40";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 10:59:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 10:59:40', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7424
UPDATE user SET loginip = "" WHERE userid = 4;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:31:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:01:45", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:01:45', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7425

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acc934890e3c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 11:01:45', '06acc934890e3c', '1', '0.00', '0', '0', '1', '3960.00', '3960', '3960', '0', '1', '2026-10-12 11:01:45', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '8' ,'0','','','','','-1','0','0','0','0','0','3960','0','','0','0','3960','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=412
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','412', '0', '2026-10-12 11:01:45', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3960', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 11:01:45','0','0','',''); -- id=543
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 449;
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 ('420','01597', '412', '117', '1597', '8', '495', '3960', '0', '', '0', '2026-10-12 11:01:45', '1597', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','449-8,','1','1','0','0','495','3960','0','','0','0.00','0','0','0','0'); -- id=1484
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 1484;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1597, '2026-10-12', 3960, 3360, 3360
                    , 3360, 3360, 3360, 3360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 3360, 3360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3960, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3960, 3360, 3360
                    , 3360, 3360, 3360, 3360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3360, 3360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3960, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '87', userid = '6', storedetaildate = '2026-10-12 11:01:45' WHERE storedetailid = '1622';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1597', '1', '8', '1', '412', 'اضافة فاتورة مبيعات', 'sellbillController.php', '95', '87', '6', '2026-10-12 11:01:45','0','0'); -- id=4607
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '108390',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('104430','3960', '0', '4', 'اضافة فاتورة مبيعات', '412', '108390', '2026-10-12 11:01:45', '6',  'sellbillController.php','1','','0'); -- id=516
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3960', '3960', '2026-10-12', '6', '0', '0', '2026-10-12 11:01:45','اضافة فاتورة مبيعات رقم 412','1','0',null,'0','412','sellbillController.php?do=showDetail&sellbillid=412'); -- id=2059
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2059', '568', '3960', '','0'); -- id=2100
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '108390', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2059', '143', '3960', '','0'); -- id=2061
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4173435', 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 ( '3360', '3360', '2026-10-12', '6', '0', '0', '2026-10-12 11:01:45','اضافة فاتورة مبيعات رقم 412 - صرف البضاعة من المخزن','1','0',null,'0','412','sellbillController.php?do=showDetail&sellbillid=412'); -- id=2060
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2060', '402', '3360', '','0'); -- id=2101
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3901897.73', 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 ('2060', '382', '3360', '','0'); -- id=2062
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19686607.97', 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='2059,0,2060' where sellbillid=412;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 3960, 3360, 3360
                    , 3360, 3360, 3360, 3360
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3360, 3360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3960, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 3960, 3360, 3360
                    , 3360, 3360, 3360, 3360
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3360, 3360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3960, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3360
                        , returnSellVal = returnSellVal+0, 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, 3960, 3360, 3360
                    , 3360, 3360, 3360, 3360, 3360, 3360)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3960, netSellCostBuyPrice = netSellCostBuyPrice+3360
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3360
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3360
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3360
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3360
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3360
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3360
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3360;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acc934890e3c and sellbillId = 412 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:31:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:01:45", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:01:45', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7426
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:32:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:02:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:02:26', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=7427
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 ('موديل 101 ضرب نار','','124','560','560','560','560','2026-10-12','0','1','0','','0','0','0','0','0','560','560','560','560','560','0','0','0','0','.','0','0','0','560','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','560','560','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','560','0','0','0','0','0','0','','','0','0','0','0'); -- id=1836
UPDATE product SET productName = 'موديل 101 ضرب نار', productDescription = '', productCatId = '124', productBuyPrice = '560', productSellAllPrice = '560', productSellUnitPrice = '560', productSellHalfPrice = '560', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01836',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '560',meanbuyprice = '560',meanbuyprice_withDiscount = '560' , productbuypricereal = '560' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',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='560',meanbuyprice_withTax='560',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='560',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1836';
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', '1836', '1.00', '2026-10-12', '1', '0','0183601','560','560','560','560','','0','0','0','0','0','0','0','0','0','0'); -- id=1836
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1836', '1', '0', '1', '2026-10-12'); -- id=2851
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1836', '1', '0', '0', '1836', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4608
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1836, 1,'2026-10-12 11:02:26',1)
                ON DUPLICATE KEY UPDATE productid = 1836, edited = 1, sysdate = '2026-10-12 11:02:26', userid = 1; -- id=2758
UPDATE product SET productName = 'موديل 101 ضرب نار', productDescription = '', productCatId = '124', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '560.00', productSellHalfPrice = '560.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01836',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '560',meanbuyprice = '560',meanbuyprice_withDiscount = '560' , productbuypricereal = '560' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='560',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='560',meanbuyprice_withTax='560',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='560',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1836';
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 ('موديل 102 ضرب نار ','','124','475','475','475','475','2026-10-12','0','1','0','','0','0','0','0','0','475','475','475','475','475','0','0','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=1837
UPDATE product SET productName = 'موديل 102 ضرب نار ', productDescription = '', productCatId = '124', productBuyPrice = '475', productSellAllPrice = '475', productSellUnitPrice = '475', productSellHalfPrice = '475', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01837',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 = '0' , 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 = '1837';
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', '1837', '1.00', '2026-10-12', '1', '0','0183701','475','475','475','475','','0','0','0','0','0','0','0','0','0','0'); -- id=1837
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1837', '1', '0', '1', '2026-10-12'); -- id=2852
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1837', '1', '0', '0', '1837', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4609
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1837, 1,'2026-10-12 11:02:26',1)
                ON DUPLICATE KEY UPDATE productid = 1837, edited = 1, sysdate = '2026-10-12 11:02:26', userid = 1; -- id=2759
UPDATE product SET productName = 'موديل 102 ضرب نار ', productDescription = '', productCatId = '124', productBuyPrice = '475.00', productSellAllPrice = '475.00', productSellUnitPrice = '475.00', productSellHalfPrice = '475.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01837',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 = '0' , 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 = '1837';
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 ('موديل103 ضرب نار ','','124','440','440','440','440','2026-10-12','0','1','0','','0','0','0','0','0','440','440','440','440','440','0','0','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=1838
UPDATE product SET productName = 'موديل103 ضرب نار ', productDescription = '', productCatId = '124', productBuyPrice = '440', productSellAllPrice = '440', productSellUnitPrice = '440', productSellHalfPrice = '440', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01838',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 = '0' , 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 = '1838';
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', '1838', '1.00', '2026-10-12', '1', '0','0183801','440','440','440','440','','0','0','0','0','0','0','0','0','0','0'); -- id=1838
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1838', '1', '0', '1', '2026-10-12'); -- id=2853
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1838', '1', '0', '0', '1838', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4610
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1838, 1,'2026-10-12 11:02:26',1)
                ON DUPLICATE KEY UPDATE productid = 1838, edited = 1, sysdate = '2026-10-12 11:02:26', userid = 1; -- id=2760
UPDATE product SET productName = 'موديل103 ضرب نار ', productDescription = '', productCatId = '124', productBuyPrice = '440.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01838',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 = '0' , 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 = '1838';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:32:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:02:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:02:28', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7428
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:32:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:02:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:02:28', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7429
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:34:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:04:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:04:00', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=7430
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 ('06acc9415486fb', '2026-10-12 11:02:29', '118', '-101475.80', '-59220.2', '8', '1', '45930.00',  '42255.60', '0', '42255.6', '1', '2026-10-12 11:04:00', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=104
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 ('01836', '104', '124', '1836', '33', '560', '18480.00', '0', '', '2026-10-12 11:04:00', '1836','','','0','0','0','0','0',null,'560','18480','0','0','0','0','0','0','0','0','1'); -- id=668
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 11:02:29', 1, 1836, 0, 0
                    , 515.2, 33, 0, 0, 1, '2026-10-12 11:04:00')
                ON DUPLICATE KEY UPDATE buyprice = 515.2,
                        buyQuantity =buyQuantity+33, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 11:04:00' ; -- id=861
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1836', '560', '33', '0', 'buyBillController.php', '668', '', '0', '0'); -- id=527
UPDATE product SET  productBuyPrice = "560" WHERE productId = 1836 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 668 ;
UPDATE product SET productName = 'موديل 101 ضرب نار', productDescription = '', productCatId = '124', productBuyPrice = '560.00', productSellAllPrice = '560.00', productSellUnitPrice = '560.00', productSellHalfPrice = '560.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01836',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '515.2',meanbuyprice = '560',meanbuyprice_withDiscount = '515.2' , productbuypricereal = '560.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='560',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='560',meanbuyprice_withTax='560',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='515.2',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1836';
UPDATE buybilldetail SET  lastbuyprice = 560 , meanbuyprice = 560, lastbuyprice_withDiscount = 515.2, meanbuyprice_withDiscount = 515.2
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 515.2
                where buybilldetailid = 668;
UPDATE productunit SET proUnitBuyPrice  = 560 * productnumber WHERE productid = 1836;
UPDATE storedetail SET  productquantity = '33', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2851';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1836', '1', '33', '0', '104', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '33', '1', '2026-10-12 11:02:29','0','0'); -- id=4611
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 ('01837', '104', '124', '1837', '30', '475', '14250.00', '0', '', '2026-10-12 11:04:00', '1837','','','0','0','0','0','0',null,'475','14250','0','0','0','0','0','0','0','0','1'); -- id=669
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 11:02:29', 1, 1837, 0, 0
                    , 437, 30, 0, 0, 1, '2026-10-12 11:04:00')
                ON DUPLICATE KEY UPDATE buyprice = 437,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 11:04:00' ; -- id=862
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1837', '475', '30', '0', 'buyBillController.php', '669', '', '0', '0'); -- id=528
UPDATE product SET  productBuyPrice = "475" WHERE productId = 1837 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 669 ;
UPDATE product SET productName = 'موديل 102 ضرب نار ', productDescription = '', productCatId = '124', productBuyPrice = '475.00', productSellAllPrice = '475.00', productSellUnitPrice = '475.00', productSellHalfPrice = '475.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01837',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '475',lastbuyprice_withDiscount = '437',meanbuyprice = '475',meanbuyprice_withDiscount = '437' , productbuypricereal = '475.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='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='437',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1837';
UPDATE buybilldetail SET  lastbuyprice = 475 , meanbuyprice = 475, lastbuyprice_withDiscount = 437, meanbuyprice_withDiscount = 437
        , lastbuyprice_withTax = 475, meanbuyprice_withTax = 475, lastbuyprice_withDiscountAndTax = 437
                where buybilldetailid = 669;
UPDATE productunit SET proUnitBuyPrice  = 475 * productnumber WHERE productid = 1837;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2852';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1837', '1', '30', '0', '104', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-12 11:02:29','0','0'); -- id=4612
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 ('01838', '104', '124', '1838', '30', '440', '13200.00', '0', '', '2026-10-12 11:04:00', '1838','','','0','0','0','0','0',null,'440','13200','0','0','0','0','0','0','0','0','1'); -- id=670
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 11:02:29', 1, 1838, 0, 0
                    , 404.8, 30, 0, 0, 1, '2026-10-12 11:04:00')
                ON DUPLICATE KEY UPDATE buyprice = 404.8,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 11:04:00' ; -- id=863
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1838', '440', '30', '0', 'buyBillController.php', '670', '', '0', '0'); -- id=529
UPDATE product SET  productBuyPrice = "440" WHERE productId = 1838 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 670 ;
UPDATE product SET productName = 'موديل103 ضرب نار ', productDescription = '', productCatId = '124', productBuyPrice = '440.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01838',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440',lastbuyprice_withDiscount = '404.8',meanbuyprice = '440',meanbuyprice_withDiscount = '404.8' , productbuypricereal = '440.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='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='404.8',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1838';
UPDATE buybilldetail SET  lastbuyprice = 440 , meanbuyprice = 440, lastbuyprice_withDiscount = 404.8, meanbuyprice_withDiscount = 404.8
        , lastbuyprice_withTax = 440, meanbuyprice_withTax = 440, lastbuyprice_withDiscountAndTax = 404.8
                where buybilldetailid = 670;
UPDATE productunit SET proUnitBuyPrice  = 440 * productnumber WHERE productid = 1838;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2853';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1838', '1', '30', '0', '104', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-12 11:02:29','0','0'); -- id=4613
UPDATE supplier SET  suppliercurrentDebt = '-59220.2',suppliercurrentDebtInCurrency= '-59220.2' , userid = '1', supplierdate = '2026-10-12 11:04:00'   WHERE supplierid = '118';
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 ('118', '-101475.80', '42255.6', '0', 'اضافة فاتورة مشتريات', '104', '-59220.2', '2026-10-12 11:02:29', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','42255.6','1','-101475.8','42255.6','-59220.2','0',''); -- id=372
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '42255.6', '42255.6', '2026-10-12', '1', '0', '0', '2026-10-12 11:04:00','اضافة فاتورة مشتريات رقم 104','1','0',null,'0','104','buyBillController.php?do=details&id=104'); -- id=2061
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2061', '382', '42255.6', '','0'); -- id=2102
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19728863.57', 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 ('2061', '601', '42255.6', '','0'); -- id=2063
UPDATE accountstree SET name = 'ضرب نار', customName = 'ضرب نار', customNameEn = 'ضرب نار', nameEn = 'ضرب نار', parent = '81', accountNature = '1', theValue = '-59220.2', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-08 10:25:59' WHERE id = '601';
update buybill set dailyentryid='2061,0' where buybillid=104;
COMMIT;
UPDATE product SET overAllAveragePrice = 515.2 WHERE productId = 1836;UPDATE product SET overAllAveragePrice = 437 WHERE productId = 1837;UPDATE product SET overAllAveragePrice = 404.8 WHERE productId = 1838;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:34:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:04:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:04:00', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=104'); -- id=7431
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:34:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:04:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:04:03', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=104&type=2'); -- id=7432
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:35:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:05:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:05:45', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=104&type=2'); -- id=7433
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:35:48";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:05:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:05:48', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=104'); -- id=7434
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:35:50";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:05:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:05:51', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7435
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:36:35";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:06:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 11:06:35', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7436
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:37:01";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:07:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 11:07:01', '1', 'add2', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=7437
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-10-12','','93', '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=141
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (141, 1,'2026-10-12 11:07:01',1)
                ON DUPLICATE KEY UPDATE catid = 141, edited = 1, sysdate = '2026-10-12 11:07:01', userid = 1; -- id=153
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:37:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:07:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 11:07:02', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=7438
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:37:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:07:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 11:07:03', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=7439
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:37:05";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:07:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:07:05', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7440
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:38:40";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:08:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:08:40', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=7441
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 ('موديل كب شو ستيفو','','141','450','450','450','450','2026-10-12','0','1','0','','0','0','0','0','0','450','450','450','450','450','0','0','0','0','.','0','0','0','450','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','450','450','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','450','0','0','0','0','0','0','','','0','0','0','0'); -- id=1839
UPDATE product SET productName = 'موديل كب شو ستيفو', productDescription = '', productCatId = '141', productBuyPrice = '450', productSellAllPrice = '450', productSellUnitPrice = '450', productSellHalfPrice = '450', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01839',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '450',meanbuyprice_withDiscount = '450' , productbuypricereal = '450' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',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='450',meanbuyprice_withTax='450',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='450',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1839';
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', '1839', '1', '2026-10-12', '1', '0','0183901','450','450','450','450','','0','0','0','0','0','0','0','0','0','0'); -- id=1839
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1839', '1', '0', '1', '2026-10-12'); -- id=2854
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1839', '1', '0', '0', '1839', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4614
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1839, 1,'2026-10-12 11:08:40',1)
                ON DUPLICATE KEY UPDATE productid = 1839, edited = 1, sysdate = '2026-10-12 11:08:40', userid = 1; -- id=2761
UPDATE product SET productName = 'موديل كب شو ستيفو', productDescription = '', productCatId = '141', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01839',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '450',meanbuyprice_withDiscount = '450' , productbuypricereal = '450' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',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='450',meanbuyprice_withTax='450',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='450',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1839';
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 ('موديل روند ستيفو','','141','330','330','330','330','2026-10-12','0','1','0','','0','0','0','0','0','330','330','330','330','330','0','0','0','0','.','0','0','0','330','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','330','330','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','330','0','0','0','0','0','0','','','0','0','0','0'); -- id=1840
UPDATE product SET productName = 'موديل روند ستيفو', productDescription = '', productCatId = '141', productBuyPrice = '330', productSellAllPrice = '330', productSellUnitPrice = '330', productSellHalfPrice = '330', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01840',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '330',meanbuyprice = '330',meanbuyprice_withDiscount = '330' , productbuypricereal = '330' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='330',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='330',meanbuyprice_withTax='330',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='330',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1840';
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', '1840', '1', '2026-10-12', '1', '0','0184001','330','330','330','330','','0','0','0','0','0','0','0','0','0','0'); -- id=1840
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1840', '1', '0', '1', '2026-10-12'); -- id=2855
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1840', '1', '0', '0', '1840', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4615
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1840, 1,'2026-10-12 11:08:40',1)
                ON DUPLICATE KEY UPDATE productid = 1840, edited = 1, sysdate = '2026-10-12 11:08:40', userid = 1; -- id=2762
UPDATE product SET productName = 'موديل روند ستيفو', productDescription = '', productCatId = '141', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01840',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '330',meanbuyprice = '330',meanbuyprice_withDiscount = '330' , productbuypricereal = '330' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='330',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='330',meanbuyprice_withTax='330',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='330',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1840';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:38:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:08:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:08:41', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7442
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:38:43";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:08:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:08:43', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7443
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-10-12 11:10:06', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=152
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 ('152', '0', '', '0', 'إضافة مورد جديد', '152', '', '2026-10-12 11:10:06', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=373
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-10-12 11:10:07'); -- id=635
UPDATE supplier SET suppliername = 'ستيفو', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-12', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='635',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '152';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:41:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:11:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:11:28', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add&return_url=1&billnameid=1'); -- id=7444
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 ('06acc958b8402b', '2026-10-12 11:08:43', '152', '0.00', '85455', '10', '1', '94950.00',  '85455.00', '0', '85455', '1', '2026-10-12 11:11:28', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=105
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 ('01839', '105', '141', '1839', '90', '450', '40500.00', '0', '', '2026-10-12 11:11:28', '1839','','','0','0','0','0','0',null,'450','40500','0','0','0','0','0','0','0','0','1'); -- id=671
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 11:08:43', 1, 1839, 0, 0
                    , 405, 90, 0, 0, 1, '2026-10-12 11:11:28')
                ON DUPLICATE KEY UPDATE buyprice = 405,
                        buyQuantity =buyQuantity+90, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 11:11:28' ; -- id=864
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1839', '450', '90', '0', 'buyBillController.php', '671', '', '0', '0'); -- id=530
UPDATE product SET  productBuyPrice = "450" WHERE productId = 1839 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 671 ;
UPDATE product SET productName = 'موديل كب شو ستيفو', productDescription = '', productCatId = '141', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01839',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '405',meanbuyprice = '450',meanbuyprice_withDiscount = '405' , productbuypricereal = '450.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='450',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='450',meanbuyprice_withTax='450',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='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1839';
UPDATE buybilldetail SET  lastbuyprice = 450 , meanbuyprice = 450, lastbuyprice_withDiscount = 405, meanbuyprice_withDiscount = 405
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 405
                where buybilldetailid = 671;
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 1839;
UPDATE storedetail SET  productquantity = '90', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2854';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1839', '1', '90', '0', '105', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '90', '1', '2026-10-12 11:08:43','0','0'); -- id=4616
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 ('01840', '105', '141', '1840', '165', '330', '54450.00', '0', '', '2026-10-12 11:11:28', '1840','','','0','0','0','0','0',null,'330','54450','0','0','0','0','0','0','0','0','1'); -- id=672
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 11:08:43', 1, 1840, 0, 0
                    , 297, 165, 0, 0, 1, '2026-10-12 11:11:28')
                ON DUPLICATE KEY UPDATE buyprice = 297,
                        buyQuantity =buyQuantity+165, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 11:11:28' ; -- id=865
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1840', '330', '165', '0', 'buyBillController.php', '672', '', '0', '0'); -- id=531
UPDATE product SET  productBuyPrice = "330" WHERE productId = 1840 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 672 ;
UPDATE product SET productName = 'موديل روند ستيفو', productDescription = '', productCatId = '141', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01840',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '297',meanbuyprice = '330',meanbuyprice_withDiscount = '297' , productbuypricereal = '330.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='330',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='330',meanbuyprice_withTax='330',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='297',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1840';
UPDATE buybilldetail SET  lastbuyprice = 330 , meanbuyprice = 330, lastbuyprice_withDiscount = 297, meanbuyprice_withDiscount = 297
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 297
                where buybilldetailid = 672;
UPDATE productunit SET proUnitBuyPrice  = 330 * productnumber WHERE productid = 1840;
UPDATE storedetail SET  productquantity = '165', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2855';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1840', '1', '165', '0', '105', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '165', '1', '2026-10-12 11:08:43','0','0'); -- id=4617
UPDATE supplier SET  suppliercurrentDebt = '85455',suppliercurrentDebtInCurrency= '85455' , userid = '1', supplierdate = '2026-10-12 11:11:28'   WHERE supplierid = '152';
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 ('152', '0.00', '85455', '0', 'اضافة فاتورة مشتريات', '105', '85455', '2026-10-12 11:08:43', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','85455','1','0','85455','85455','0',''); -- id=374
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '85455', '85455', '2026-10-12', '1', '0', '0', '2026-10-12 11:11:28','اضافة فاتورة مشتريات رقم 105','1','0',null,'0','105','buyBillController.php?do=details&id=105'); -- id=2062
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2062', '382', '85455', '','0'); -- id=2103
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19814318.57', 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 ('2062', '635', '85455', '','0'); -- id=2064
UPDATE accountstree SET name = 'ستيفو', customName = 'ستيفو', customNameEn = 'ستيفو', nameEn = 'ستيفو', parent = '81', accountNature = '1', theValue = '85455', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 11:10:07' WHERE id = '635';
update buybill set dailyentryid='2062,0' where buybillid=105;
COMMIT;
UPDATE product SET overAllAveragePrice = 405 WHERE productId = 1839;UPDATE product SET overAllAveragePrice = 297 WHERE productId = 1840;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:41:29";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:11:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:11:29', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7445
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:41:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:11:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:11:42', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7446
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:41:52";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:11:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:11:52', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7447
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:42:09";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:12:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:12:09', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7448
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:42:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:12:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:12:16', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7449
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:42:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:12:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:12:33', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7450
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:42:51";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:42:51";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:42:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:12:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 11:12:53', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7451
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:42:53";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 11:12:53', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7452
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:42:57";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:12:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:12:57', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7453
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:44:01";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:14:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:14:01', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7454
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:44:46";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:14:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 11:14:47', '2', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7455
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:44:47";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 11:14:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 11:14:47', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7456
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:44:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:14:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:14:49', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7457
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:45:40";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:15:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:15:40', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7458

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acc96f96c687
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 11:15:40', '06acc96f96c687', '1', '0.00', '0', '0', '1', '1770.00', '1770', '1770', '0', '1', '2026-10-12 11:15:40', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','1770','0','','0','0','1770','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=413
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','اضافة فاتورة مبيعات','413', '0', '2026-10-12 11:15:40', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1770', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 11:15:40','0','0','',''); -- id=544
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 73;
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 ('260','01381', '413', '94', '1381', '6', '295', '1770', '0', '', '0', '2026-10-12 11:15:40', '1381', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','73-6,','1','1','0','0','295','1770','0','','0','0.00','0','0','0','0'); -- id=1485
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 1485;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1381, '2026-10-12', 1770, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-10-12', 1770, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '285', userid = '2', storedetaildate = '2026-10-12 11:15:40' WHERE storedetailid = '1381';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1381', '1', '6', '1', '413', 'اضافة فاتورة مبيعات', 'sellbillController.php', '291', '285', '2', '2026-10-12 11:15:40','0','0'); -- id=4618
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2389355',  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 ('2387585','1770', '0', '2', 'اضافة فاتورة مبيعات', '413', '2389355', '2026-10-12 11:15:40', '2',  'sellbillController.php','1','','0'); -- id=517
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1770', '1770', '2026-10-12', '2', '0', '0', '2026-10-12 11:15:40','اضافة فاتورة مبيعات رقم 413','1','0',null,'0','413','sellbillController.php?do=showDetail&sellbillid=413'); -- id=2063
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2063', '419', '1770', '','0'); -- id=2104
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2389355', 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 ('2063', '143', '1770', '','0'); -- id=2065
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4175205', 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 ( '1560', '1560', '2026-10-12', '2', '0', '0', '2026-10-12 11:15:40','اضافة فاتورة مبيعات رقم 413 - صرف البضاعة من المخزن','1','0',null,'0','413','sellbillController.php?do=showDetail&sellbillid=413'); -- id=2064
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2064', '402', '1560', '','0'); -- id=2105
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3903457.73', 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 ('2064', '382', '1560', '','0'); -- id=2066
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19812758.57', 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='2063,0,2064' where sellbillid=413;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 1770, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 1770, 1560, 1560
                    , 1560, 1560, 1560, 1560
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1560, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1770, 1560, 1560
                    , 1560, 1560, 1560, 1560, 1560, 1560)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1770, netSellCostBuyPrice = netSellCostBuyPrice+1560
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1560
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1560
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1560
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1560
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1560
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1560
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1560;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acc96f96c687 and sellbillId = 413 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:45:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:15:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:15:41', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7459
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:47:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:17:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:17:08', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7460
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:47:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:17:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:17:13', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7461
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:48:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:18:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:18:17', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7462

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acc8c62e012a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 11:18:17', '06acc8c62e012a', '1', '0.00', '0', '0', '1', '21275.00', '21275', '21275', '0', '1', '2026-10-12 11:18:17', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '40' ,'0','','','','','-1','0','0','0','0','0','21275','0','','0','0','21275','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=414
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','اضافة فاتورة مبيعات','414', '0', '2026-10-12 11:18:17', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '21275', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 11:18:17','0','0','',''); -- id=545
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 767;
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 ('425','01793', '414', '138', '1793', '15', '455', '6825', '0', '', '0', '2026-10-12 11:18:17', '1793', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','767-15,','1','1','0','0','455','6825','0','','0','0.00','0','0','0','0'); -- id=1486
UPDATE sellbilldetail SET  lastbuyprice = 425.00 , meanbuyprice = 425.00, lastbuyprice_withDiscount = 425.00, meanbuyprice_withDiscount = 425.00
        , lastbuyprice_withTax = 425, meanbuyprice_withTax = 425, lastbuyprice_withDiscountAndTax = 425
                where sellbilldetailid = 1486;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1793, '2026-10-12', 6825, 6375, 6375
                    , 6375, 6375, 6375, 6375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 6375, 6375, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6825, sellCostBuyPrice =sellCostBuyPrice+6375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6375
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6375
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 6825, 6375, 6375
                    , 6375, 6375, 6375, 6375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6375, 6375, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6825, sellCostBuyPrice =sellCostBuyPrice+6375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6375
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6375
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-12 11:18:17' WHERE storedetailid = '2806';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1793', '1', '15', '1', '414', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '9', '2', '2026-10-12 11:18:17','0','0'); -- id=4619
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 380;
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 ('680','87559', '414', '28', '1562', '5', '700', '3500', '0', '', '0', '2026-10-12 11:18:17', '1562', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','380-5,','1','1','0','0','700','3500','0','','0','0.00','0','0','0','0'); -- id=1487
UPDATE sellbilldetail SET  lastbuyprice = 680.00 , meanbuyprice = 680.00, lastbuyprice_withDiscount = 680.00, meanbuyprice_withDiscount = 680.00
        , lastbuyprice_withTax = 680, meanbuyprice_withTax = 680, lastbuyprice_withDiscountAndTax = 680
                where sellbilldetailid = 1487;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1562, '2026-10-12', 3500, 3400, 3400
                    , 3400, 3400, 3400, 3400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3400, 3400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3500, sellCostBuyPrice =sellCostBuyPrice+3400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3500, 3400, 3400
                    , 3400, 3400, 3400, 3400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3400, 3400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3500, sellCostBuyPrice =sellCostBuyPrice+3400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 11:18:17' WHERE storedetailid = '1587';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1562', '1', '5', '1', '414', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '2', '2026-10-12 11:18:17','0','0'); -- id=4620
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 ('530','09607', '414', '37', '1095', '10', '550', '5500', '0', '', '0', '2026-10-12 11:18:17', '1095', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','550','5500','0','','0','0.00','0','0','0','0'); -- id=1488
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 1488;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1095, '2026-10-12', 5500, 5300, 5300
                    , 5300, 5300, 5300, 5300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 5300, 5300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5500, sellCostBuyPrice =sellCostBuyPrice+5300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 5500, 5300, 5300
                    , 5300, 5300, 5300, 5300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5300, 5300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5500, sellCostBuyPrice =sellCostBuyPrice+5300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 11:18:17' WHERE storedetailid = '1095';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1095', '1', '10', '1', '414', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '20', '2', '2026-10-12 11:18:17','0','0'); -- id=4621
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 ('520','09738', '414', '34', '1070', '5', '540', '2700', '0', '', '0', '2026-10-12 11:18:17', '1070', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','540','2700','0','','0','0.00','0','0','0','0'); -- id=1489
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 520.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 520.00
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 520, lastbuyprice_withDiscountAndTax = 520
                where sellbilldetailid = 1489;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1070, '2026-10-12', 2700, 2600, 2600
                    , 2600, 2600, 2600, 2600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2600, 2600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2700, 2600, 2600
                    , 2600, 2600, 2600, 2600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2600, 2600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '40', userid = '2', storedetaildate = '2026-10-12 11:18:17' WHERE storedetailid = '1070';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1070', '1', '5', '1', '414', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '40', '2', '2026-10-12 11:18:17','0','0'); -- id=4622
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 ('530','09460', '414', '37', '1092', '5', '550', '2750', '0', '', '0', '2026-10-12 11:18:17', '1092', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','550','2750','0','','0','0.00','0','0','0','0'); -- id=1490
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 1490;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1092, '2026-10-12', 2750, 2650, 2650
                    , 2650, 2650, 2650, 2650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2650, 2650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2750, 2650, 2650
                    , 2650, 2650, 2650, 2650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2650, 2650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 11:18:17' WHERE storedetailid = '1092';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1092', '1', '5', '1', '414', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-12 11:18:17','0','0'); -- id=4623
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2410630',  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 ('2389355','21275', '0', '2', 'اضافة فاتورة مبيعات', '414', '2410630', '2026-10-12 11:18:17', '2',  'sellbillController.php','1','','0'); -- id=518
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '21275', '21275', '2026-10-12', '2', '0', '0', '2026-10-12 11:18:17','اضافة فاتورة مبيعات رقم 414','1','0',null,'0','414','sellbillController.php?do=showDetail&sellbillid=414'); -- id=2065
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2065', '419', '21275', '','0'); -- id=2106
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2410630', 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 ('2065', '143', '21275', '','0'); -- id=2067
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4196480', 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 ( '20325', '20325', '2026-10-12', '2', '0', '0', '2026-10-12 11:18:17','اضافة فاتورة مبيعات رقم 414 - صرف البضاعة من المخزن','1','0',null,'0','414','sellbillController.php?do=showDetail&sellbillid=414'); -- id=2066
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2066', '402', '20325', '','0'); -- id=2107
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3923782.73', 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 ('2066', '382', '20325', '','0'); -- id=2068
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19792433.57', 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='2065,0,2066' where sellbillid=414;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 21275, 20325, 20325
                    , 20325, 20325, 20325, 20325
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,20325, 20325, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+21275, sellCostBuyPrice =sellCostBuyPrice+20325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+20325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+20325
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+20325, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+20325
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+20325
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+20325
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+20325
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 21275, 20325, 20325
                    , 20325, 20325, 20325, 20325
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,20325, 20325, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+21275, sellCostBuyPrice =sellCostBuyPrice+20325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+20325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+20325
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+20325, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+20325
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+20325
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+20325
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+20325
                        , returnSellVal = returnSellVal+0, 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, 21275, 20325, 20325
                    , 20325, 20325, 20325, 20325, 20325, 20325)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+21275, netSellCostBuyPrice = netSellCostBuyPrice+20325
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+20325
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+20325
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+20325
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+20325
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+20325
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+20325
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+20325;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acc8c62e012a and sellbillId = 414 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:48:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:18:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:18:17', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7463
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:48:33";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:48: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-10-12 07:48:36";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:18:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 11:18:36', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7464
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:48:36";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 11:18:36', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7465
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:48:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:18:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:18:42', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7466
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:50:40";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:50:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:20:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 11:20:42', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7467
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:50:42";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 11:20:42', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7468
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:50:46";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:20:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:20:46', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7469
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:51:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:21:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('unitController.php', '2026-10-12 11:21:12', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/unitController.php?do=show'); -- id=7470
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:51:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:21:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:21:17', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7471
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:51:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:21:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:21:20', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7472
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:51:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:21:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 11:21:41', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7473
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:51:59";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:21:59", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:21:59', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7474

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acc93e9e986b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 11:21:59', '06acc93e9e986b', '1', '0.00', '0', '0', '1', '10920.00', '10920', '10920', '0', '1', '2026-10-12 11:21:59', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '22' ,'0','','','','','-1','0','0','0','0','0','10920','0','','0','0','10920','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=415
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','415', '0', '2026-10-12 11:21:59', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '10920', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 11:21:59','0','0','',''); -- id=546
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+16 where id = 449;
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 ('420','01597', '415', '117', '1597', '16', '495', '7920', '0', '', '0', '2026-10-12 11:21:59', '1597', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','449-16,','1','1','0','0','495','7920','0','','0','0.00','0','0','0','0'); -- id=1491
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 1491;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1597, '2026-10-12', 7920, 6720, 6720
                    , 6720, 6720, 6720, 6720
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16, 0, 6720, 6720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7920, sellCostBuyPrice =sellCostBuyPrice+6720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6720
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6720
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6720
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 7920, 6720, 6720
                    , 6720, 6720, 6720, 6720
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6720, 6720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7920, sellCostBuyPrice =sellCostBuyPrice+6720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6720
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6720
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6720
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '71', userid = '6', storedetaildate = '2026-10-12 11:21:59' WHERE storedetailid = '1622';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1597', '1', '16', '1', '415', 'اضافة فاتورة مبيعات', 'sellbillController.php', '87', '71', '6', '2026-10-12 11:21:59','0','0'); -- id=4624
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 55;
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 ('440','01370', '415', '91', '1370', '6', '500', '3000', '0', '', '0', '2026-10-12 11:21:59', '1370', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','55-6,','1','1','0','0','500','3000','0','','0','0.00','0','0','0','0'); -- id=1492
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 440.00
        , lastbuyprice_withTax = 440, meanbuyprice_withTax = 440, lastbuyprice_withDiscountAndTax = 440
                where sellbilldetailid = 1492;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1370, '2026-10-12', 3000, 2640, 2640
                    , 2640, 2640, 2640, 2640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2640, 2640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+2640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3000, 2640, 2640
                    , 2640, 2640, 2640, 2640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2640, 2640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+2640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '60', userid = '6', storedetaildate = '2026-10-12 11:21:59' WHERE storedetailid = '1370';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1370', '1', '6', '1', '415', 'اضافة فاتورة مبيعات', 'sellbillController.php', '66', '60', '6', '2026-10-12 11:21:59','0','0'); -- id=4625
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '119310',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('108390','10920', '0', '4', 'اضافة فاتورة مبيعات', '415', '119310', '2026-10-12 11:21:59', '6',  'sellbillController.php','1','','0'); -- id=519
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10920', '10920', '2026-10-12', '6', '0', '0', '2026-10-12 11:21:59','اضافة فاتورة مبيعات رقم 415','1','0',null,'0','415','sellbillController.php?do=showDetail&sellbillid=415'); -- id=2067
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2067', '568', '10920', '','0'); -- id=2108
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '119310', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2067', '143', '10920', '','0'); -- id=2069
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4207400', 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 ( '9360', '9360', '2026-10-12', '6', '0', '0', '2026-10-12 11:21:59','اضافة فاتورة مبيعات رقم 415 - صرف البضاعة من المخزن','1','0',null,'0','415','sellbillController.php?do=showDetail&sellbillid=415'); -- id=2068
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2068', '402', '9360', '','0'); -- id=2109
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3933142.73', 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 ('2068', '382', '9360', '','0'); -- id=2070
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19783073.57', 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='2067,0,2068' where sellbillid=415;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 10920, 9360, 9360
                    , 9360, 9360, 9360, 9360
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9360, 9360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10920, sellCostBuyPrice =sellCostBuyPrice+9360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 10920, 9360, 9360
                    , 9360, 9360, 9360, 9360
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9360, 9360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10920, sellCostBuyPrice =sellCostBuyPrice+9360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9360
                        , returnSellVal = returnSellVal+0, 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, 10920, 9360, 9360
                    , 9360, 9360, 9360, 9360, 9360, 9360)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+10920, netSellCostBuyPrice = netSellCostBuyPrice+9360
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+9360
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+9360
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+9360
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+9360
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+9360
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+9360
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+9360;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acc93e9e986b and sellbillId = 415 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:51:59";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:21:59", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:21:59', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7475
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:52:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:22:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 11:22:07', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7476
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:52:52";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:22:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:22:52', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7477
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:53:09";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:23:09", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:23:09', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7478

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acc98a7b180e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 11:23:09', '06acc98a7b180e', '1', '0.00', '0', '0', '1', '1980.00', '1980', '1980', '0', '1', '2026-10-12 11:23:09', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1980','0','','0','0','1980','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=416
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','416', '0', '2026-10-12 11:23:09', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1980', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 11:23:09','0','0','',''); -- id=547
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 291;
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','01513', '416', '109', '1513', '3', '660', '1980', '0', '', '0', '2026-10-12 11:23:09', '1513', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','291-3,','1','1','0','0','660','1980','0','','0','0.00','0','0','0','0'); -- id=1493
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 = 1493;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1513, '2026-10-12', 1980, 1890, 1890
                    , 1890, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1890, 1890, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1890
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1890, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1890
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1890
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1890
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1980, 1890, 1890
                    , 1890, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1890, 1890, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1890
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1890, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1890
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1890
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1890
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-12 11:23:09' WHERE storedetailid = '1538';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1513', '1', '3', '1', '416', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '24', '6', '2026-10-12 11:23:09','0','0'); -- id=4626
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '121290',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('119310','1980', '0', '4', 'اضافة فاتورة مبيعات', '416', '121290', '2026-10-12 11:23:09', '6',  'sellbillController.php','1','','0'); -- id=520
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1980', '1980', '2026-10-12', '6', '0', '0', '2026-10-12 11:23:09','اضافة فاتورة مبيعات رقم 416','1','0',null,'0','416','sellbillController.php?do=showDetail&sellbillid=416'); -- id=2069
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2069', '568', '1980', '','0'); -- id=2110
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '121290', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2069', '143', '1980', '','0'); -- id=2071
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4209380', 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 ( '1890', '1890', '2026-10-12', '6', '0', '0', '2026-10-12 11:23:09','اضافة فاتورة مبيعات رقم 416 - صرف البضاعة من المخزن','1','0',null,'0','416','sellbillController.php?do=showDetail&sellbillid=416'); -- id=2070
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2070', '402', '1890', '','0'); -- id=2111
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3935032.73', 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 ('2070', '382', '1890', '','0'); -- id=2072
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19781183.57', 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='2069,0,2070' where sellbillid=416;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 1980, 1890, 1890
                    , 1890, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1890, 1890, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1890
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1890, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1890
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1890
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1890
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 1980, 1890, 1890
                    , 1890, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1890, 1890, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1890
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1890, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1890
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1890
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1890
                        , returnSellVal = returnSellVal+0, 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, 1980, 1890, 1890
                    , 1890, 1890, 1890, 1890, 1890, 1890)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1980, netSellCostBuyPrice = netSellCostBuyPrice+1890
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1890
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1890
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1890
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1890
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1890
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1890
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1890;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acc98a7b180e and sellbillId = 416 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:53:10";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:23:10", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:23:10', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7479
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:53:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:23:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 11:23:16', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7480
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:53:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:23:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:23:18', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7481
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:53:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:23:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:23:20', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7482
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:53:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:23:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 11:23:22', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7483
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:53:22";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 11:23:22', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7484
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:53:31";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:53:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:23:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 11:23:33', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7485
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:53:33";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 11:23:33', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7486
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:55:27";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:25:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:25:27', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7487
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:55:27";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:25:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:25:27', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7488
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:55:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:25:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 11:25:45', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7489
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 07:55:45";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 11:25:45', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7490
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:15:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:45:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:45:23', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7491
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:15:27";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:45:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:45:27', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7492

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acc97ca02537
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 11:45:27', '06acc97ca02537', '1', '0.00', '0', '0', '1', '6810.00', '6810', '6810', '0', '1', '2026-10-12 11:45:27', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '15' ,'0','','','','','-1','0','0','0','0','0','6810','0','','0','0','6810','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=417
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','اضافة فاتورة مبيعات','417', '0', '2026-10-12 11:45:27', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '6810', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 11:45:27','0','0','',''); -- id=548
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 564;
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 ('423.2','01701', '417', '128', '1701', '6', '460', '2760', '0', '', '0', '2026-10-12 11:45:27', '1701', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','564-6,','1','1','0','0','460','2760','0','','0','0.00','0','0','0','0'); -- id=1494
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 423.20, meanbuyprice_withDiscount = 441.60
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 423.2
                where sellbilldetailid = 1494;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1701, '2026-10-12', 2760, 2760, 2760
                    , 2760, 2539.2, 2649.6, 2539.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2760, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2760, sellCostBuyPrice =sellCostBuyPrice+2760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2539.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2649.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2539.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2760, 2760, 2760
                    , 2760, 2539.2, 2649.6, 2539.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2760, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2760, sellCostBuyPrice =sellCostBuyPrice+2760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2539.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2649.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2539.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 11:45:27' WHERE storedetailid = '2713';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1701', '1', '6', '1', '417', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '18', '2', '2026-10-12 11:45:27','0','0'); -- id=4627
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 790;
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 ('405','01807', '417', '122', '1807', '9', '450', '4050', '0', '', '0', '2026-10-12 11:45:27', '1807', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','790-9,','1','1','0','0','450','4050','0','','0','0.00','0','0','0','0'); -- id=1495
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 405.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 405
                where sellbilldetailid = 1495;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1807, '2026-10-12', 4050, 4050, 4050
                    , 4050, 3645, 3645, 3645
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4050, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3645, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3645
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3645
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 4050, 4050, 4050
                    , 4050, 3645, 3645, 3645
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4050, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3645, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3645
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3645
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 11:45:27' WHERE storedetailid = '2821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1807', '1', '9', '1', '417', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '30', '2', '2026-10-12 11:45:27','0','0'); -- id=4628
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2417440',  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 ('2410630','6810', '0', '2', 'اضافة فاتورة مبيعات', '417', '2417440', '2026-10-12 11:45:27', '2',  'sellbillController.php','1','','0'); -- id=521
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6810', '6810', '2026-10-12', '2', '0', '0', '2026-10-12 11:45:27','اضافة فاتورة مبيعات رقم 417','1','0',null,'0','417','sellbillController.php?do=showDetail&sellbillid=417'); -- id=2071
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2071', '419', '6810', '','0'); -- id=2112
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2417440', 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 ('2071', '143', '6810', '','0'); -- id=2073
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4216190', 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 ( '6184.2', '6184.2', '2026-10-12', '2', '0', '0', '2026-10-12 11:45:27','اضافة فاتورة مبيعات رقم 417 - صرف البضاعة من المخزن','1','0',null,'0','417','sellbillController.php?do=showDetail&sellbillid=417'); -- id=2072
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2072', '402', '6184.2', '','0'); -- id=2113
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3941216.93', 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 ('2072', '382', '6184.2', '','0'); -- id=2074
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19774999.37', 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='2071,0,2072' where sellbillid=417;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 6810, 6810, 6810
                    , 6810, 6184.2, 6294.6, 6184.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6810, 5430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6810, sellCostBuyPrice =sellCostBuyPrice+6810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6184.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6294.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6184.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 6810, 6810, 6810
                    , 6810, 6184.2, 6294.6, 6184.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6810, 5430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6810, sellCostBuyPrice =sellCostBuyPrice+6810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6184.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6294.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6184.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5430
                        , returnSellVal = returnSellVal+0, 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, 6810, 6810, 6810
                    , 6810, 6184.2, 6294.6, 6184.2, 6810, 5430)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+6810, netSellCostBuyPrice = netSellCostBuyPrice+6810
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6810
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6810
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6184.2
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6294.6
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6184.2
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6810
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5430;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acc97ca02537 and sellbillId = 417 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:15:27";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:45:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:45:27', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7493
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:20:57";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:50:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 11:50:57', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7494
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:21:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:51:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 11:51:58', '1', 'add2', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=7495
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-10-12','','93', '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=142
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (142, 1,'2026-10-12 11:51:58',1)
                ON DUPLICATE KEY UPDATE catid = 142, edited = 1, sysdate = '2026-10-12 11:51:58', userid = 1; -- id=154
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:21:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:51:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 11:51:58', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=7496
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:22:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:52:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 11:52:00', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=7497
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:22:01";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:52:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:52:01', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7498
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:22:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:52:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:52:20', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=7499
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:23:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:53:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:53:38', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7500

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acc9fc4df1ef
-- ----------------------------------------------------------------------------------------------------

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-10-12 11:53:38', '06acc9fc4df1ef', '1', '0.00', '0', '0', '1', '1365', '1365', '-1365', '0', '1', '2026-10-12 11:53:38', '', '2', '0', 'نقدي','2', '0', '5', '0', 'نقدي', '3', '0', '', '','','','-1','0','0','0','','0','-1365','0','0','0','0','0','0','0','0','-1','0','0','1','','0'); -- id=13
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','اضافة فاتورة مردوات مبيعات','13', '0', '2026-10-12 11:53:38', '2', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '1365', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 11:53:38','0','0','',''); -- id=549
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 ('425.00', '01793', '13', '138', '1793', '3', '455', '1365', '0', '', '0', '0', '1793', '0.00', '-1','1','0','','','0','0','0','0','0','0','1','1','','0','0','455','1365','0','','0'); -- id=21
UPDATE returnsellbilldetail SET  lastbuyprice = 425.00 , meanbuyprice = 425.00, lastbuyprice_withDiscount = 425.00, meanbuyprice_withDiscount = 425.00
        , lastbuyprice_withTax = 425, meanbuyprice_withTax = 425, lastbuyprice_withDiscountAndTax = 425
                where returnsellbilldetailid = 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 (1793, '2026-10-12', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1365, 1275, 1275, 1275
                    , 1275, 1275, 1275, 0, 3, 0, 0, 1275, 1275)
                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+1365, returnSellCostBuyPrice = returnSellCostBuyPrice+1275, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1275
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1275, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1275
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1275
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1275
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1275
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1275
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+3;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1365, 1275, 1275, 1275
                    , 1275, 1275, 1275, 0, 0, 1275, 1275)
                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+1365, returnSellCostBuyPrice = returnSellCostBuyPrice+1275, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1275
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1275, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1275
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1275
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1275
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1275
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1275;
UPDATE storedetail SET  productquantity = '12', userid = '2', storedetaildate = '2026-10-12 11:53:38' WHERE storedetailid = '2806';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1793', '1', '3', '0', '13', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '9', '12', '2', '2026-10-12 11:53:38','0','0'); -- id=4629
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2416075',  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 ('2417440','-1365', '1', '2', 'اضافة فاتورة مردوات مبيعات', '13', '2416075', '2026-10-12 11:53:38', '2',  'returnsellbillController.php','1','','0'); -- id=522
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1365', '1365', '2026-10-12', '2', '0', '0', '2026-10-12 11:53:38','اضافة فاتورة مردود مبيعات رقم 13','1','0',null,'0','13','returnsellbillController.php?do=showDetail&returnsellbillid=13'); -- id=2073
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2073', '143', '1365', '','0'); -- id=2114
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4214825', 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 ('2073', '419', '1365', '','0'); -- id=2075
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2416075', 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 ( '1275', '1275', '2026-10-12', '2', '0', '0', '2026-10-12 11:53:38','اضافة فاتورة مردود مبيعات رقم 13 - صرف البضاعة من المخزن','1','0',null,'0','13','returnsellbillController.php?do=showDetail&returnsellbillid=13'); -- id=2074
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2074', '382', '1275', '','0'); -- id=2115
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19776274.37', 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 ('2074', '402', '1275', '','0'); -- id=2076
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3939941.93', 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='2073,0,2074' where returnsellbillid=13;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1365, 1275, 1275, 1275
                    , 1275, 1275, 1275 ,0, 0, 1275, 1275)
                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+1365, returnSellCostBuyPrice = returnSellCostBuyPrice+1275, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1275
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1275, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1275
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1275
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1275
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1275
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1275;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1365, 1275, 1275, 1275
                    , 1275, 1275, 1275 ,0, 0, 1275, 1275)
                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+1365, returnSellCostBuyPrice = returnSellCostBuyPrice+1275, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1275
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1275, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1275
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1275
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1275
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1275
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1275;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -1365, -1275, -1275
                    , -1275, -1275, -1275, -1275, -1275, -1275)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-1365, netSellCostBuyPrice = netSellCostBuyPrice+-1275
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-1275
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-1275
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-1275
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-1275
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-1275
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-1275
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-1275;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acc9fc4df1ef and sellbillId = 13 and returnsellbillId = 13
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:23:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:53:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:53:38', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=7501
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:24:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:54:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:54:02', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7502
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:24:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:54:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:54:06', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=7503
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 ('زنط مستر جيد تكس','','142','250','250','250','250','2026-10-12','0','1','0','','0','0','0','0','0','250','250','250','250','250','0','0','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=1841
UPDATE product SET productName = 'زنط مستر جيد تكس', productDescription = '', productCatId = '142', productBuyPrice = '250', productSellAllPrice = '250', productSellUnitPrice = '250', productSellHalfPrice = '250', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01841',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '250',meanbuyprice = '250',meanbuyprice_withDiscount = '250' , productbuypricereal = '250' , buypricereal_precentage = '0' , buytotal_precentage = '0' , 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 = '1841';
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', '1841', '1', '2026-10-12', '1', '0','0184101','250','250','250','250','','0','0','0','0','0','0','0','0','0','0'); -- id=1841
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1841', '1', '0', '1', '2026-10-12'); -- id=2856
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '0', '0', '1841', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4630
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1841, 1,'2026-10-12 11:54:06',1)
                ON DUPLICATE KEY UPDATE productid = 1841, edited = 1, sysdate = '2026-10-12 11:54:06', userid = 1; -- id=2763
UPDATE product SET productName = 'زنط مستر جيد تكس', productDescription = '', productCatId = '142', productBuyPrice = '250.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01841',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '250',meanbuyprice = '250',meanbuyprice_withDiscount = '250' , productbuypricereal = '250' , buypricereal_precentage = '0' , buytotal_precentage = '0' , 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 = '1841';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:24:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:54:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:54:12', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7504
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:24:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:54:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:54:26', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7505
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:24:46";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:54:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:54:46', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7506

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acca02a8352b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 11:54:46', '06acca02a8352b', '1', '0.00', '0', '0', '1', '990.00', '990', '990', '0', '1', '2026-10-12 11:54:46', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','990','0','','0','0','990','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=418
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','اضافة فاتورة مبيعات','418', '0', '2026-10-12 11:54:46', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '990', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 11:54:46','0','0','',''); -- id=550
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 789;
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 ('297','01806', '418', '122', '1806', '3', '330', '990', '0', '', '0', '2026-10-12 11:54:46', '1806', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','789-3,','1','1','0','0','330','990','0','','0','0.00','0','0','0','0'); -- id=1496
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 297.00, meanbuyprice_withDiscount = 297.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 297
                where sellbilldetailid = 1496;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1806, '2026-10-12', 990, 990, 990
                    , 990, 891, 891, 891
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 990, 990, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+891, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+891
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+891
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+990
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+990
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 990, 990, 990
                    , 990, 891, 891, 891
                    , 0, 0, 0, 0
                    , 0, 0, 0, 990, 990, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+891, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+891
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+891
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+990
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+990
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-12 11:54:46' WHERE storedetailid = '2820';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1806', '1', '3', '1', '418', 'اضافة فاتورة مبيعات', 'sellbillController.php', '51', '48', '2', '2026-10-12 11:54:46','0','0'); -- id=4631
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2417065',  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 ('2416075','990', '0', '2', 'اضافة فاتورة مبيعات', '418', '2417065', '2026-10-12 11:54:46', '2',  'sellbillController.php','1','','0'); -- id=523
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '990', '990', '2026-10-12', '2', '0', '0', '2026-10-12 11:54:46','اضافة فاتورة مبيعات رقم 418','1','0',null,'0','418','sellbillController.php?do=showDetail&sellbillid=418'); -- id=2075
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2075', '419', '990', '','0'); -- id=2116
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2417065', 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 ('2075', '143', '990', '','0'); -- id=2077
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4215815', 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 ( '891', '891', '2026-10-12', '2', '0', '0', '2026-10-12 11:54:46','اضافة فاتورة مبيعات رقم 418 - صرف البضاعة من المخزن','1','0',null,'0','418','sellbillController.php?do=showDetail&sellbillid=418'); -- id=2076
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2076', '402', '891', '','0'); -- id=2117
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3940832.93', 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 ('2076', '382', '891', '','0'); -- id=2078
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19775383.37', 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='2075,0,2076' where sellbillid=418;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 990, 990, 990
                    , 990, 891, 891, 891
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,990, 990, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+891, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+891
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+891
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+990
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+990
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 990, 990, 990
                    , 990, 891, 891, 891
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,990, 990, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+990
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+990, sellCostMeanBuyPrice = sellCostMeanBuyPrice+990
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+891, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+891
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+891
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+990
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+990
                        , returnSellVal = returnSellVal+0, 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, 990, 990, 990
                    , 990, 891, 891, 891, 990, 990)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+990, netSellCostBuyPrice = netSellCostBuyPrice+990
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+990
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+990
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+891
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+891
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+891
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+990
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+990;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acca02a8352b and sellbillId = 418 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:24:47";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:54:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:54:47', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7507
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-10-12 11:54:53', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=153
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 ('153', '0', '', '0', 'إضافة مورد جديد', '153', '', '2026-10-12 11:54:53', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=375
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-10-12 11:54:53'); -- id=636
UPDATE supplier SET suppliername = 'مستر جيد تكس', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-12', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='636',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '153';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:25:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:55:12", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:55:12', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7508

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acc98ee1ab9f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 11:55:12', '06acc98ee1ab9f', '1', '0.00', '0', '0', '1', '2600.00', '2600', '2600', '0', '1', '2026-10-12 11:55:12', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','2600','0','','0','0','2600','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=419
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','419', '0', '2026-10-12 11:55:12', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2600', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 11:55:12','0','0','',''); -- id=551
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 391;
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 ('490','01572', '419', '31', '1572', '5', '520', '2600', '0', '', '0', '2026-10-12 11:55:12', '1572', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','391-5,','1','1','0','0','520','2600','0','','0','0.00','0','0','0','0'); -- id=1497
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 490.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 490
                where sellbilldetailid = 1497;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1572, '2026-10-12', 2600, 2450, 2450
                    , 2450, 2450, 2450, 2450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2450, 1225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2600, sellCostBuyPrice =sellCostBuyPrice+2450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1225
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2600, 2450, 2450
                    , 2450, 2450, 2450, 2450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2450, 1225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2600, sellCostBuyPrice =sellCostBuyPrice+2450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1225
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-12 11:55:12' WHERE storedetailid = '1597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1572', '1', '5', '1', '419', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '19', '6', '2026-10-12 11:55:12','0','0'); -- id=4632
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '123890',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('121290','2600', '0', '4', 'اضافة فاتورة مبيعات', '419', '123890', '2026-10-12 11:55:12', '6',  'sellbillController.php','1','','0'); -- id=524
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2600', '2600', '2026-10-12', '6', '0', '0', '2026-10-12 11:55:12','اضافة فاتورة مبيعات رقم 419','1','0',null,'0','419','sellbillController.php?do=showDetail&sellbillid=419'); -- id=2077
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2077', '568', '2600', '','0'); -- id=2118
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '123890', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2077', '143', '2600', '','0'); -- id=2079
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4218415', 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 ( '2450', '2450', '2026-10-12', '6', '0', '0', '2026-10-12 11:55:12','اضافة فاتورة مبيعات رقم 419 - صرف البضاعة من المخزن','1','0',null,'0','419','sellbillController.php?do=showDetail&sellbillid=419'); -- id=2078
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2078', '402', '2450', '','0'); -- id=2119
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3943282.93', 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 ('2078', '382', '2450', '','0'); -- id=2080
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19772933.37', 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='2077,0,2078' where sellbillid=419;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2600, 2450, 2450
                    , 2450, 2450, 2450, 2450
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2450, 1225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2600, sellCostBuyPrice =sellCostBuyPrice+2450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1225
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2600, 2450, 2450
                    , 2450, 2450, 2450, 2450
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2450, 1225, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2600, sellCostBuyPrice =sellCostBuyPrice+2450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1225
                        , returnSellVal = returnSellVal+0, 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, 2600, 2450, 2450
                    , 2450, 2450, 2450, 2450, 2450, 1225)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2600, netSellCostBuyPrice = netSellCostBuyPrice+2450
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2450
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2450
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2450
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2450
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2450
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2450
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1225;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acc98ee1ab9f and sellbillId = 419 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:25:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:55:12", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:55:12', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7509
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:26:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:56:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:56:07', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=7510
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 ('06acca04219049', '2026-10-12 11:54:26', '153', '0.00', '45900', '15', '1', '54000.00',  '45900.00', '0', '45900', '1', '2026-10-12 11:56:07', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=106
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 ('01841', '106', '142', '1841', '216', '250', '54000.00', '0', '', '2026-10-12 11:56:07', '1841','','','0','0','0','0','0',null,'250','54000','0','0','0','0','0','0','0','0','1'); -- id=673
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 11:54:26', 1, 1841, 0, 0
                    , 212.5, 216, 0, 0, 1, '2026-10-12 11:56:07')
                ON DUPLICATE KEY UPDATE buyprice = 212.5,
                        buyQuantity =buyQuantity+216, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 11:56:07' ; -- id=866
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1841', '250', '216', '0', 'buyBillController.php', '673', '', '0', '0'); -- id=532
UPDATE product SET  productBuyPrice = "250" WHERE productId = 1841 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 673 ;
UPDATE product SET productName = 'زنط مستر جيد تكس', productDescription = '', productCatId = '142', productBuyPrice = '250.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01841',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '212.5',meanbuyprice = '250',meanbuyprice_withDiscount = '212.5' , productbuypricereal = '250.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='250',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='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='212.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 = '1841';
UPDATE buybilldetail SET  lastbuyprice = 250 , meanbuyprice = 250, lastbuyprice_withDiscount = 212.5, meanbuyprice_withDiscount = 212.5
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 250, lastbuyprice_withDiscountAndTax = 212.5
                where buybilldetailid = 673;
UPDATE productunit SET proUnitBuyPrice  = 250 * productnumber WHERE productid = 1841;
UPDATE storedetail SET  productquantity = '216', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '216', '0', '106', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '216', '1', '2026-10-12 11:54:26','0','0'); -- id=4633
UPDATE supplier SET  suppliercurrentDebt = '45900',suppliercurrentDebtInCurrency= '45900' , userid = '1', supplierdate = '2026-10-12 11:56:07'   WHERE supplierid = '153';
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 ('153', '0.00', '45900', '0', 'اضافة فاتورة مشتريات', '106', '45900', '2026-10-12 11:54:26', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','45900','1','0','45900','45900','0',''); -- id=376
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '45900', '45900', '2026-10-12', '1', '0', '0', '2026-10-12 11:56:07','اضافة فاتورة مشتريات رقم 106','1','0',null,'0','106','buyBillController.php?do=details&id=106'); -- id=2079
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2079', '382', '45900', '','0'); -- id=2120
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19818833.37', 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 ('2079', '636', '45900', '','0'); -- id=2081
UPDATE accountstree SET name = 'مستر جيد تكس', customName = 'مستر جيد تكس', customNameEn = 'مستر جيد تكس', nameEn = 'مستر جيد تكس', parent = '81', accountNature = '1', theValue = '45900', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 11:54:53' WHERE id = '636';
update buybill set dailyentryid='2079,0' where buybillid=106;
COMMIT;
UPDATE product SET overAllAveragePrice = 212.5 WHERE productId = 1841;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:26:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:56:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:56:08', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=106'); -- id=7511
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:26:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:56:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:56:23', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=106&type=2'); -- id=7512
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:27:35";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:27:48";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:57:48", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 11:57:48', '4', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7513
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:27:48";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 11:57:48", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 11:57:48', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7514
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:27:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:57:53", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 11:57:53', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7515
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:29:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:59:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:59:03', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=106&type=2'); -- id=7516
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:29:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:59:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:59:06', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=106'); -- id=7517
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:29:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:59:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 11:59:08', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7518
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:29:11";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:59:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:59:11', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7519
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:29:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:59:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 11:59:13', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7520
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:29:14";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:59:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 11:59:15', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=7521
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:29:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:59:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 11:59:16', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7522
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:29:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 11:59:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 11:59:18', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7523
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:29:18";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 11:59:18', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7524
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:30:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:00:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:00:45', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7525
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:30:50";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:00:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:00:50', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7526

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acca0570cca7
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 12:00:50', '06acca0570cca7', '1', '0.00', '0', '0', '1', '12090.00', '12090', '12090', '0', '1', '2026-10-12 12:00:50', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '30' ,'0','','','','','-1','0','0','0','0','0','12090','0','','0','0','12090','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=420
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','اضافة فاتورة مبيعات','420', '0', '2026-10-12 12:00:50', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '12090', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 12:00:50','0','0','',''); -- id=552
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 546;
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 ('414','01644', '420', '122', '1644', '6', '460', '2760', '0', '', '0', '2026-10-12 12:00:50', '1644', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','546-6,','1','1','0','0','460','2760','0','','0','0.00','0','0','0','0'); -- id=1498
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 414.00, meanbuyprice_withDiscount = 414.00
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 414
                where sellbilldetailid = 1498;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1644, '2026-10-12', 2760, 2760, 2760
                    , 2760, 2484, 2484, 2484
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2760, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2760, sellCostBuyPrice =sellCostBuyPrice+2760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2484, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2484
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2484
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2760
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2760, 2760, 2760
                    , 2760, 2484, 2484, 2484
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2760, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2760, sellCostBuyPrice =sellCostBuyPrice+2760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2484, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2484
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2484
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2760
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 12:00:50' WHERE storedetailid = '1669';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1644', '1', '6', '1', '420', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '6', '2', '2026-10-12 12:00:50','0','0'); -- id=4634
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 559;
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 ('386.4','01695', '420', '127', '1695', '9', '420', '3780', '0', '', '0', '2026-10-12 12:00:50', '1695', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','559-9,','1','1','0','0','420','3780','0','','0','0.00','0','0','0','0'); -- id=1499
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 386.40, meanbuyprice_withDiscount = 386.40
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 386.4
                where sellbilldetailid = 1499;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1695, '2026-10-12', 3780, 3780, 3780
                    , 3780, 3477.6, 3477.6, 3477.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3780, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3477.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3477.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3477.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 3780, 3780, 3780
                    , 3780, 3477.6, 3477.6, 3477.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3780, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3477.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3477.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3477.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '108', userid = '2', storedetaildate = '2026-10-12 12:00:50' WHERE storedetailid = '2707';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1695', '1', '9', '1', '420', 'اضافة فاتورة مبيعات', 'sellbillController.php', '117', '108', '2', '2026-10-12 12:00:50','0','0'); -- id=4635
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 789;
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 ('297','01806', '420', '122', '1806', '9', '330', '2970', '0', '', '0', '2026-10-12 12:00:50', '1806', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','789-9,','1','1','0','0','330','2970','0','','0','0.00','0','0','0','0'); -- id=1500
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 297.00, meanbuyprice_withDiscount = 297.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 297
                where sellbilldetailid = 1500;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1806, '2026-10-12', 2970, 2970, 2970
                    , 2970, 2673, 2673, 2673
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2970, 2970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2970, sellCostBuyPrice =sellCostBuyPrice+2970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2673, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2673
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2673
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2970
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2970, 2970, 2970
                    , 2970, 2673, 2673, 2673
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2970, 2970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2970, sellCostBuyPrice =sellCostBuyPrice+2970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2673, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2673
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2673
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2970
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '39', userid = '2', storedetaildate = '2026-10-12 12:00:50' WHERE storedetailid = '2820';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1806', '1', '9', '1', '420', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '39', '2', '2026-10-12 12:00:50','0','0'); -- id=4636
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 332;
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 ('410','01462', '420', '103', '1462', '6', '430', '2580', '0', '', '0', '2026-10-12 12:00:50', '1462', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','332-6,','1','1','0','0','430','2580','0','','0','0.00','0','0','0','0'); -- id=1501
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 1501;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1462, '2026-10-12', 2580, 2460, 2460
                    , 2460, 2460, 2460, 2460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2580, 2460, 2460
                    , 2460, 2460, 2460, 2460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '180', userid = '2', storedetaildate = '2026-10-12 12:00:50' WHERE storedetailid = '1487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1462', '1', '6', '1', '420', 'اضافة فاتورة مبيعات', 'sellbillController.php', '186', '180', '2', '2026-10-12 12:00:50','0','0'); -- id=4637
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2429155',  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 ('2417065','12090', '0', '2', 'اضافة فاتورة مبيعات', '420', '2429155', '2026-10-12 12:00:50', '2',  'sellbillController.php','1','','0'); -- id=525
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '12090', '12090', '2026-10-12', '2', '0', '0', '2026-10-12 12:00:50','اضافة فاتورة مبيعات رقم 420','1','0',null,'0','420','sellbillController.php?do=showDetail&sellbillid=420'); -- id=2080
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2080', '419', '12090', '','0'); -- id=2121
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2429155', 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 ('2080', '143', '12090', '','0'); -- id=2082
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4230505', 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 ( '11094.6', '11094.6', '2026-10-12', '2', '0', '0', '2026-10-12 12:00:50','اضافة فاتورة مبيعات رقم 420 - صرف البضاعة من المخزن','1','0',null,'0','420','sellbillController.php?do=showDetail&sellbillid=420'); -- id=2081
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2081', '402', '11094.6', '','0'); -- id=2122
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3954377.53', 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 ('2081', '382', '11094.6', '','0'); -- id=2083
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19807738.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='2080,0,2081' where sellbillid=420;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 12090, 11970, 11970
                    , 11970, 11094.6, 11094.6, 11094.6
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11970, 11970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12090, sellCostBuyPrice =sellCostBuyPrice+11970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11094.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11094.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11094.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11970
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 12090, 11970, 11970
                    , 11970, 11094.6, 11094.6, 11094.6
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11970, 11970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12090, sellCostBuyPrice =sellCostBuyPrice+11970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11094.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11094.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11094.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11970
                        , returnSellVal = returnSellVal+0, 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, 12090, 11970, 11970
                    , 11970, 11094.6, 11094.6, 11094.6, 11970, 11970)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+12090, netSellCostBuyPrice = netSellCostBuyPrice+11970
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+11970
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+11970
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+11094.6
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+11094.6
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+11094.6
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+11970
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+11970;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acca0570cca7 and sellbillId = 420 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:30:50";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:00:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:00:50', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7527
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:35:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:05:18", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:05:18', '4', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7528

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acca11125f54
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 12:05:18', '06acca11125f54', '1', '0.00', '0', '0', '1', '5790.00', '5790', '5790', '0', '2', '2026-10-12 12:05:18', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '19' ,'0','','','','','-1','0','0','0','0','0','5790','0','','0','0','5790','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=421
UPDATE client SET  clientdebt = '0', userid = '4' 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','اضافة فاتورة مبيعات','421', '0', '2026-10-12 12:05:18', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5790', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 12:05:18','0','0','',''); -- id=553
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 133;
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','01325', '421', '87', '1325', '3', '390', '1170', '0', '', '0', '2026-10-12 12:05:18', '1325', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','133-3,','1','1','0','0','390','1170','0','','0','0.00','0','0','0','0'); -- id=1502
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 = 1502;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1325, '2026-10-12', 1170, 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+1170, 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 (2, '2026-10-12', 1170, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1050, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1170, 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 = '218', userid = '4', storedetaildate = '2026-10-12 12:05:18' WHERE storedetailid = '1406';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1325', '2', '3', '1', '421', 'اضافة فاتورة مبيعات', 'sellbillController.php', '221', '218', '4', '2026-10-12 12:05:18','0','0'); -- id=4638
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 780;
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 ('252','01779', '421', '99', '1779', '15', '280', '4200', '0', '', '0', '2026-10-12 12:05:18', '1779', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','780-15,','1','1','0','0','280','4200','0','','0','0.00','0','0','0','0'); -- id=1503
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.00, lastbuyprice_withDiscount = 252.00, meanbuyprice_withDiscount = 252.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 252
                where sellbilldetailid = 1503;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1779, '2026-10-12', 4200, 4200, 4200
                    , 4200, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 4200, 4200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (2, '2026-10-12', 4200, 4200, 4200
                    , 4200, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4200, 4200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '4', storedetaildate = '2026-10-12 12:05:18' WHERE storedetailid = '2810';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1779', '2', '15', '1', '421', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '5', '4', '2026-10-12 12:05:18','0','0'); -- id=4639
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 135;
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 ('380','i0001326', '421', '87', '1326', '1', '420', '420', '0', '', '0', '2026-10-12 12:05:18', '1326', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','135-1,','1','1','0','0','420','420','0','','0','0.00','0','0','0','0'); -- id=1504
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 1504;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1326, '2026-10-12', 420, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 380, 380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-12', 420, 380, 380
                    , 380, 380, 380, 380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 380, 380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '146', userid = '4', storedetaildate = '2026-10-12 12:05:18' WHERE storedetailid = '1407';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1326', '2', '1', '1', '421', 'اضافة فاتورة مبيعات', 'sellbillController.php', '147', '146', '4', '2026-10-12 12:05:18','0','0'); -- id=4640
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '498040',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('492250','5790', '0', '3', 'اضافة فاتورة مبيعات', '421', '498040', '2026-10-12 12:05:18', '4',  'sellbillController.php','1','','0'); -- id=526
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5790', '5790', '2026-10-12', '4', '0', '0', '2026-10-12 12:05:18','اضافة فاتورة مبيعات رقم 421','1','0',null,'0','421','sellbillController.php?do=showDetail&sellbillid=421'); -- id=2082
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2082', '501', '5790', '','0'); -- id=2123
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '498040', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2082', '143', '5790', '','0'); -- id=2084
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4236295', 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 ( '5210', '5210', '2026-10-12', '4', '0', '0', '2026-10-12 12:05:18','اضافة فاتورة مبيعات رقم 421 - صرف البضاعة من المخزن','1','0',null,'0','421','sellbillController.php?do=showDetail&sellbillid=421'); -- id=2083
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2083', '402', '5210', '','0'); -- id=2124
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3959587.53', 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 ('2083', '492', '5210', '','0'); -- id=2085
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1111015', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='2082,0,2083' where sellbillid=421;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 5790, 5630, 5630
                    , 5630, 5210, 5210, 5210
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5630, 5630, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5790, sellCostBuyPrice =sellCostBuyPrice+5630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5630, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5630
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5630
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5630
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 5790, 5630, 5630
                    , 5630, 5210, 5210, 5210
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5630, 5630, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5790, sellCostBuyPrice =sellCostBuyPrice+5630
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5630, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5630
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5210
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5630
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5630
                        , returnSellVal = returnSellVal+0, 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, 5790, 5630, 5630
                    , 5630, 5210, 5210, 5210, 5630, 5630)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5790, netSellCostBuyPrice = netSellCostBuyPrice+5630
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+5630
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+5630
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5210
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+5210
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+5210
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+5630
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5630;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acca11125f54 and sellbillId = 421 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:35:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:05:18", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:05:18', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7529
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:38:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:08:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 12:08:13', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7530
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:38:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:08:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 12:08:13', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7531
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:39:19";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:09:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 12:09:19', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7532
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:39:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:09:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 12:09:22', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7533
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:39:22";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 12:09:22', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7534
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:43:35";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:13:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:13:35', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7535

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acca1bda5bad
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 12:13:35', '06acca1bda5bad', '1', '0.00', '0', '0', '1', '7300.00', '7300', '7300', '0', '1', '2026-10-12 12:13:35', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '19' ,'0','','','','','-1','0','0','0','0','0','7300','0','','0','0','7300','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=422
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','اضافة فاتورة مبيعات','422', '0', '2026-10-12 12:13:35', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '7300', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 12:13:35','0','0','',''); -- id=554
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 355;
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 ('276','01467', '422', '104', '1467', '4', '340', '1360', '0', '', '0', '2026-10-12 12:13:35', '1467', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','355-4,','1','1','0','0','340','1360','0','','0','0.00','0','0','0','0'); -- id=1505
UPDATE sellbilldetail SET  lastbuyprice = 276.00 , meanbuyprice = 276.00, lastbuyprice_withDiscount = 276.00, meanbuyprice_withDiscount = 276.00
        , lastbuyprice_withTax = 276, meanbuyprice_withTax = 276, lastbuyprice_withDiscountAndTax = 276
                where sellbilldetailid = 1505;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1467, '2026-10-12', 1360, 1104, 1104
                    , 1104, 1104, 1104, 1104
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1104, 1104, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1360, sellCostBuyPrice =sellCostBuyPrice+1104
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1104, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1104
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1104, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1104
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1104
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1104
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1104
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1360, 1104, 1104
                    , 1104, 1104, 1104, 1104
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1104, 1104, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1360, sellCostBuyPrice =sellCostBuyPrice+1104
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1104, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1104
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1104, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1104
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1104
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1104
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1104
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '620', userid = '2', storedetaildate = '2026-10-12 12:13:35' WHERE storedetailid = '1492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '4', '1', '422', 'اضافة فاتورة مبيعات', 'sellbillController.php', '624', '620', '2', '2026-10-12 12:13:35','0','0'); -- id=4641
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 790;
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 ('405','01807', '422', '122', '1807', '6', '450', '2700', '0', '', '0', '2026-10-12 12:13:35', '1807', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','790-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=1506
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 405.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 405
                where sellbilldetailid = 1506;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1807, '2026-10-12', 2700, 2700, 2700
                    , 2700, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2700, 2700, 2700
                    , 2700, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 12:13:35' WHERE storedetailid = '2821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1807', '1', '6', '1', '422', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '24', '2', '2026-10-12 12:13:35','0','0'); -- id=4642
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 235;
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','01456', '422', '94', '1456', '9', '360', '3240', '0', '', '0', '2026-10-12 12:13:35', '1456', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','235-9,','1','1','0','0','360','3240','0','','0','0.00','0','0','0','0'); -- id=1507
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 = 1507;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1456, '2026-10-12', 3240, 2880, 2880
                    , 2880, 2880, 2880, 2880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2880, 2880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3240, 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+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 3240, 2880, 2880
                    , 2880, 2880, 2880, 2880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2880, 2880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3240, 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 = '129', userid = '2', storedetaildate = '2026-10-12 12:13:35' WHERE storedetailid = '1481';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1456', '1', '9', '1', '422', 'اضافة فاتورة مبيعات', 'sellbillController.php', '138', '129', '2', '2026-10-12 12:13:35','0','0'); -- id=4643
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2436455',  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 ('2429155','7300', '0', '2', 'اضافة فاتورة مبيعات', '422', '2436455', '2026-10-12 12:13:35', '2',  'sellbillController.php','1','','0'); -- id=527
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7300', '7300', '2026-10-12', '2', '0', '0', '2026-10-12 12:13:35','اضافة فاتورة مبيعات رقم 422','1','0',null,'0','422','sellbillController.php?do=showDetail&sellbillid=422'); -- id=2084
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2084', '419', '7300', '','0'); -- id=2125
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2436455', 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 ('2084', '143', '7300', '','0'); -- id=2086
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4243595', 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 ( '6414', '6414', '2026-10-12', '2', '0', '0', '2026-10-12 12:13:35','اضافة فاتورة مبيعات رقم 422 - صرف البضاعة من المخزن','1','0',null,'0','422','sellbillController.php?do=showDetail&sellbillid=422'); -- id=2085
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2085', '402', '6414', '','0'); -- id=2126
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3966001.53', 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 ('2085', '382', '6414', '','0'); -- id=2087
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19801324.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='2084,0,2085' where sellbillid=422;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 7300, 6684, 6684
                    , 6684, 6414, 6414, 6414
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6684, 6684, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7300, sellCostBuyPrice =sellCostBuyPrice+6684
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6684, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6684
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6414, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6414
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6414
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6684
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6684
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 7300, 6684, 6684
                    , 6684, 6414, 6414, 6414
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6684, 6684, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7300, sellCostBuyPrice =sellCostBuyPrice+6684
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6684, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6684
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6414, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6414
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6414
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6684
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6684
                        , returnSellVal = returnSellVal+0, 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, 7300, 6684, 6684
                    , 6684, 6414, 6414, 6414, 6684, 6684)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+7300, netSellCostBuyPrice = netSellCostBuyPrice+6684
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6684
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6684
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6414
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6414
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6414
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6684
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+6684;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acca1bda5bad and sellbillId = 422 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:43:36";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:13:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:13:36', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7536
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:46:05";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:16:05", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 12:16:05', '4', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7537
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:49:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:19:53", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:19:53', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=7538
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:49:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:19:58", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:19:58', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7539
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:50:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:20:33", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:20:33', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7540

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acca070e7a8a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 12:20:33', '06acca070e7a8a', '1', '0.00', '0', '0', '1', '1980.00', '1980', '1980', '0', '1', '2026-10-12 12:20:33', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1980','0','','0','0','1980','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=423
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','423', '0', '2026-10-12 12:20:33', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1980', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 12:20:33','0','0','',''); -- id=555
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 449;
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 ('420','01597', '423', '117', '1597', '4', '495', '1980', '0', '', '0', '2026-10-12 12:20:33', '1597', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','449-4,','1','1','0','0','495','1980','0','','0','0.00','0','0','0','0'); -- id=1508
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 1508;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1597, '2026-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '67', userid = '6', storedetaildate = '2026-10-12 12:20:33' WHERE storedetailid = '1622';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1597', '1', '4', '1', '423', 'اضافة فاتورة مبيعات', 'sellbillController.php', '71', '67', '6', '2026-10-12 12:20:33','0','0'); -- id=4644
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '125870',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('123890','1980', '0', '4', 'اضافة فاتورة مبيعات', '423', '125870', '2026-10-12 12:20:33', '6',  'sellbillController.php','1','','0'); -- id=528
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1980', '1980', '2026-10-12', '6', '0', '0', '2026-10-12 12:20:33','اضافة فاتورة مبيعات رقم 423','1','0',null,'0','423','sellbillController.php?do=showDetail&sellbillid=423'); -- id=2086
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2086', '568', '1980', '','0'); -- id=2127
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '125870', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2086', '143', '1980', '','0'); -- id=2088
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4245575', 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 ( '1680', '1680', '2026-10-12', '6', '0', '0', '2026-10-12 12:20:33','اضافة فاتورة مبيعات رقم 423 - صرف البضاعة من المخزن','1','0',null,'0','423','sellbillController.php?do=showDetail&sellbillid=423'); -- id=2087
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2087', '402', '1680', '','0'); -- id=2128
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3967681.53', 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 ('2087', '382', '1680', '','0'); -- id=2089
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19799644.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='2086,0,2087' where sellbillid=423;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, 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, 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680, 1680, 1680)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1980, netSellCostBuyPrice = netSellCostBuyPrice+1680
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1680
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1680
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1680
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1680
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1680
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1680
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1680;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acca070e7a8a and sellbillId = 423 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:50:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:20:33", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:20:33', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7541
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:50:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:20:49", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 12:20:49', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7542
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:54:29";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:24:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 12:24:29', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7543
UPDATE supplier SET suppliername = '', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '', supplierdetails = '', conditions = null, userid = null, supplierdate = '', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='-1',sullpierCurrencyid='0',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = null;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:55:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:25:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 12:25:16', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7544
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:55:16";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 12:25:16', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7545
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:55:39";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:25:39", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:25:39', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7546
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:56:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:26:23", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:26:23', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7547

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acca793eb51d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 12:26:23', '06acca793eb51d', '1', '0.00', '0', '0', '1', '1980.00', '1980', '1980', '0', '1', '2026-10-12 12:26:23', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1980','0','','0','0','1980','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=424
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','424', '0', '2026-10-12 12:26:23', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1980', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 12:26:23','0','0','',''); -- id=556
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 449;
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 ('420','01597', '424', '117', '1597', '4', '495', '1980', '0', '', '0', '2026-10-12 12:26:23', '1597', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','449-4,','1','1','0','0','495','1980','0','','0','0.00','0','0','0','0'); -- id=1509
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 1509;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1597, '2026-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '63', userid = '6', storedetaildate = '2026-10-12 12:26:23' WHERE storedetailid = '1622';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1597', '1', '4', '1', '424', 'اضافة فاتورة مبيعات', 'sellbillController.php', '67', '63', '6', '2026-10-12 12:26:23','0','0'); -- id=4645
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '127850',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('125870','1980', '0', '4', 'اضافة فاتورة مبيعات', '424', '127850', '2026-10-12 12:26:23', '6',  'sellbillController.php','1','','0'); -- id=529
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1980', '1980', '2026-10-12', '6', '0', '0', '2026-10-12 12:26:23','اضافة فاتورة مبيعات رقم 424','1','0',null,'0','424','sellbillController.php?do=showDetail&sellbillid=424'); -- id=2088
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2088', '568', '1980', '','0'); -- id=2129
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '127850', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2088', '143', '1980', '','0'); -- id=2090
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4247555', 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 ( '1680', '1680', '2026-10-12', '6', '0', '0', '2026-10-12 12:26:23','اضافة فاتورة مبيعات رقم 424 - صرف البضاعة من المخزن','1','0',null,'0','424','sellbillController.php?do=showDetail&sellbillid=424'); -- id=2089
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2089', '402', '1680', '','0'); -- id=2130
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3969361.53', 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 ('2089', '382', '1680', '','0'); -- id=2091
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19797964.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='2088,0,2089' where sellbillid=424;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, 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, 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680, 1680, 1680)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1980, netSellCostBuyPrice = netSellCostBuyPrice+1680
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1680
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1680
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1680
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1680
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1680
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1680
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1680;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acca793eb51d and sellbillId = 424 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 08:56:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:26:23", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:26:23', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7548
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:03:50";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:33:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 12:33:50', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7549
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:03:50";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 12:33:50', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7550
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:04:01";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:34:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 12:34:01', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=7551
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:04:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:34:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 12:34:06', '1', 'editbill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=103'); -- id=7552
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:04:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:34:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 12:34:18', '1', 'update', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=7553
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 103;
UPDATE buybill SET  buybillsysdate = '2026-10-12 12:34:18', userid = '1',delbyuserid = '1', conditions = '1' WHERE buybillid = '103';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1828, 0, 0
                    , 360, 33, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-33, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=853
UPDATE buybilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 288.00, meanbuyprice_withDiscount = 288.00
        , lastbuyprice_withTax = 360.00, meanbuyprice_withTax = 360.00, lastbuyprice_withDiscountAndTax = 288.00
                where buybilldetailid = 660;
UPDATE product SET productName = 'ويد ليج lc الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01828',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '0',meanbuyprice = '360.00',meanbuyprice_withDiscount = '360' , productbuypricereal = '360.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='288',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='360',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 = '1828';
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 1828;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2843';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1828', '1', '33', '1', '103', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '33', '0', '1', '2026-10-12 09:42:45','0','0'); -- id=4646
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1829, 0, 0
                    , 350, 30, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-30, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=854
UPDATE buybilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.00
        , lastbuyprice_withTax = 350.00, meanbuyprice_withTax = 350.00, lastbuyprice_withDiscountAndTax = 280.00
                where buybilldetailid = 661;
UPDATE product SET productName = 'موديل 1234 الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01829',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '0',meanbuyprice = '350.00',meanbuyprice_withDiscount = '350' , productbuypricereal = '350.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='280',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='350',meanbuyprice_withTax='0',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='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 = '1829';
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1829;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2844';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1829', '1', '30', '1', '103', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '30', '0', '1', '2026-10-12 09:42:45','0','0'); -- id=4647
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1830, 0, 0
                    , 350, 36, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-36, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=855
UPDATE buybilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.00
        , lastbuyprice_withTax = 350.00, meanbuyprice_withTax = 350.00, lastbuyprice_withDiscountAndTax = 280.00
                where buybilldetailid = 662;
UPDATE product SET productName = 'موديل im الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01830',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '0',meanbuyprice = '350.00',meanbuyprice_withDiscount = '350' , productbuypricereal = '350.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='280',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='350',meanbuyprice_withTax='0',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='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 = '1830';
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1830;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2845';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1830', '1', '36', '1', '103', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '36', '0', '1', '2026-10-12 09:42:45','0','0'); -- id=4648
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1831, 0, 0
                    , 350, 30, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-30, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=856
UPDATE buybilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.00
        , lastbuyprice_withTax = 350.00, meanbuyprice_withTax = 350.00, lastbuyprice_withDiscountAndTax = 280.00
                where buybilldetailid = 663;
UPDATE product SET productName = 'موديل run الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01831',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '0',meanbuyprice = '350.00',meanbuyprice_withDiscount = '350' , productbuypricereal = '350.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='280',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='350',meanbuyprice_withTax='0',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='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 = '1831';
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1831;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2846';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1831', '1', '30', '1', '103', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '30', '0', '1', '2026-10-12 09:42:45','0','0'); -- id=4649
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1832, 0, 0
                    , 360, 30, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-30, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=857
UPDATE buybilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 288.00, meanbuyprice_withDiscount = 288.00
        , lastbuyprice_withTax = 360.00, meanbuyprice_withTax = 360.00, lastbuyprice_withDiscountAndTax = 288.00
                where buybilldetailid = 664;
UPDATE product SET productName = 'موديل qa  ويد ليج الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01832',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '0',meanbuyprice = '360.00',meanbuyprice_withDiscount = '360' , productbuypricereal = '360.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='288',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='360',meanbuyprice_withTax='0',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='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 = '1832';
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 1832;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2847';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1832', '1', '30', '1', '103', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '30', '0', '1', '2026-10-12 09:42:45','0','0'); -- id=4650
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1833, 0, 0
                    , 370, 24, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=858
UPDATE buybilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 296.00, meanbuyprice_withDiscount = 296.00
        , lastbuyprice_withTax = 370.00, meanbuyprice_withTax = 370.00, lastbuyprice_withDiscountAndTax = 296.00
                where buybilldetailid = 665;
UPDATE product SET productName = 'موديل حزام الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01833',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '0',meanbuyprice = '370.00',meanbuyprice_withDiscount = '370' , productbuypricereal = '370.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='296',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='0',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='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 = '1833';
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 1833;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2848';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1833', '1', '24', '1', '103', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 09:42:45','0','0'); -- id=4651
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1834, 0, 0
                    , 900, 24, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=859
UPDATE buybilldetail SET  lastbuyprice = 900.00 , meanbuyprice = 900.00, lastbuyprice_withDiscount = 720.00, meanbuyprice_withDiscount = 720.00
        , lastbuyprice_withTax = 900.00, meanbuyprice_withTax = 900.00, lastbuyprice_withDiscountAndTax = 720.00
                where buybilldetailid = 666;
UPDATE product SET productName = 'موديل بدله الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '900.00', productSellAllPrice = '900.00', productSellUnitPrice = '900.00', productSellHalfPrice = '900.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01834',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '0',meanbuyprice = '900.00',meanbuyprice_withDiscount = '900' , productbuypricereal = '900.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='720',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='900',meanbuyprice_withTax='0',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='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 = '1834';
UPDATE productunit SET proUnitBuyPrice  = 900 * productnumber WHERE productid = 1834;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2849';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1834', '1', '24', '1', '103', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 09:42:45','0','0'); -- id=4652
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1835, 0, 0
                    , 900, 24, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=860
UPDATE buybilldetail SET  lastbuyprice = 900.00 , meanbuyprice = 900.00, lastbuyprice_withDiscount = 720.00, meanbuyprice_withDiscount = 720.00
        , lastbuyprice_withTax = 900.00, meanbuyprice_withTax = 900.00, lastbuyprice_withDiscountAndTax = 720.00
                where buybilldetailid = 667;
UPDATE product SET productName = 'موديل بدله دبل الاسباني ', productDescription = '', productCatId = '48', productBuyPrice = '900.00', productSellAllPrice = '900.00', productSellUnitPrice = '900.00', productSellHalfPrice = '900.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01835',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '0',meanbuyprice = '900.00',meanbuyprice_withDiscount = '900' , productbuypricereal = '900.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='720',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='900',meanbuyprice_withTax='0',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='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 = '1835';
UPDATE productunit SET proUnitBuyPrice  = 900 * productnumber WHERE productid = 1835;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2850';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1835', '1', '24', '1', '103', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 09:42:45','0','0'); -- id=4653
UPDATE supplier SET  suppliercurrentDebt = '119638',suppliercurrentDebtInCurrency= '119638' , userid = '1', supplierdate = '2026-10-12 12:34:18'   WHERE supplierid = '11';
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 ('11', '206326.00', '86688.00', '1', 'حذف فاتورة مشتريات - للتعديل', '103', '119638', '2026-10-12 09:42:45', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','86688','1','206326','86688','119638','0',''); -- id=377
UPDATE productserial SET del = 1
		 WHERE billid = 103;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06acc8165867f5', '2026-10-12 09:42:45', '11', '119638.00', '217162', '10', '1', '108360.00', '97524.00', '0.00', '97524', '1', '2026-10-12 12:34:18', '', '1', '0', '', '1', '1','1','103','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=107
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 ('01828', '107', '48', '1828', '33.00', '360', '11880.00', '0.00', '', '2026-10-12 12:34:18', '1828','','','0','0','0','0','0',null,'360','11880','0','0','0','0','0','0','0','0','1'); -- id=674
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1828, 0, 0
                    , 324, 33, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyprice = 324,
                        buyQuantity =buyQuantity+33, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=853
UPDATE product SET  productBuyPrice = "360" WHERE productId = 1828 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 674 ;
UPDATE product SET productName = 'ويد ليج lc الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01828',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '324',meanbuyprice = '360',meanbuyprice_withDiscount = '342' , productbuypricereal = '360.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='288',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='360',meanbuyprice_withTax='180',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='324',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1828';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 324, meanbuyprice_withDiscount = 342
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 324
                where buybilldetailid = 674;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 1828;
UPDATE storedetail SET  productquantity = '33', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2843';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1828', '1', '33', '0', '107', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '33', '1', '2026-10-12 09:42:45','0','0'); -- id=4654
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 ('01829', '107', '48', '1829', '30.00', '350', '10500.00', '0.00', '', '2026-10-12 12:34:18', '1829','','','0','0','0','0','0',null,'350','10500','0','0','0','0','0','0','0','0','1'); -- id=675
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1829, 0, 0
                    , 315, 30, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyprice = 315,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=854
UPDATE product SET  productBuyPrice = "350" WHERE productId = 1829 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 675 ;
UPDATE product SET productName = 'موديل 1234 الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01829',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '315',meanbuyprice = '350',meanbuyprice_withDiscount = '332.5' , productbuypricereal = '350.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='280',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='350',meanbuyprice_withTax='175',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='315',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1829';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 315, meanbuyprice_withDiscount = 332.5
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 315
                where buybilldetailid = 675;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1829;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2844';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1829', '1', '30', '0', '107', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-12 09:42:45','0','0'); -- id=4655
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 ('01830', '107', '48', '1830', '36.00', '350', '12600.00', '0.00', '', '2026-10-12 12:34:18', '1830','','','0','0','0','0','0',null,'350','12600','0','0','0','0','0','0','0','0','1'); -- id=676
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1830, 0, 0
                    , 315, 36, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyprice = 315,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=855
UPDATE product SET  productBuyPrice = "350" WHERE productId = 1830 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 676 ;
UPDATE product SET productName = 'موديل im الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01830',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '315',meanbuyprice = '350',meanbuyprice_withDiscount = '332.5' , productbuypricereal = '350.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='280',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='350',meanbuyprice_withTax='175',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='315',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1830';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 315, meanbuyprice_withDiscount = 332.5
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 315
                where buybilldetailid = 676;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1830;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2845';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1830', '1', '36', '0', '107', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '1', '2026-10-12 09:42:45','0','0'); -- id=4656
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 ('01831', '107', '48', '1831', '30.00', '350', '10500.00', '0.00', '', '2026-10-12 12:34:18', '1831','','','0','0','0','0','0',null,'350','10500','0','0','0','0','0','0','0','0','1'); -- id=677
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1831, 0, 0
                    , 315, 30, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyprice = 315,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=856
UPDATE product SET  productBuyPrice = "350" WHERE productId = 1831 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 677 ;
UPDATE product SET productName = 'موديل run الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01831',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '315',meanbuyprice = '350',meanbuyprice_withDiscount = '332.5' , productbuypricereal = '350.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='280',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='350',meanbuyprice_withTax='175',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='315',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1831';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 315, meanbuyprice_withDiscount = 332.5
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 315
                where buybilldetailid = 677;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1831;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2846';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1831', '1', '30', '0', '107', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-12 09:42:45','0','0'); -- id=4657
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 ('01832', '107', '48', '1832', '30.00', '360', '10800.00', '0.00', '', '2026-10-12 12:34:18', '1832','','','0','0','0','0','0',null,'360','10800','0','0','0','0','0','0','0','0','1'); -- id=678
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1832, 0, 0
                    , 324, 30, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyprice = 324,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=857
UPDATE product SET  productBuyPrice = "360" WHERE productId = 1832 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 678 ;
UPDATE product SET productName = 'موديل qa  ويد ليج الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01832',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '324',meanbuyprice = '360',meanbuyprice_withDiscount = '342' , productbuypricereal = '360.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='288',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='360',meanbuyprice_withTax='180',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='324',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1832';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 324, meanbuyprice_withDiscount = 342
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 324
                where buybilldetailid = 678;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 1832;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2847';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1832', '1', '30', '0', '107', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-12 09:42:45','0','0'); -- id=4658
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 ('01833', '107', '48', '1833', '24.00', '370', '8880.00', '0.00', '', '2026-10-12 12:34:18', '1833','','','0','0','0','0','0',null,'370','8880','0','0','0','0','0','0','0','0','1'); -- id=679
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1833, 0, 0
                    , 333, 24, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyprice = 333,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=858
UPDATE product SET  productBuyPrice = "370" WHERE productId = 1833 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 679 ;
UPDATE product SET productName = 'موديل حزام الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01833',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '333',meanbuyprice = '370',meanbuyprice_withDiscount = '351.5' , productbuypricereal = '370.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='296',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='185',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='333',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1833';
UPDATE buybilldetail SET  lastbuyprice = 370 , meanbuyprice = 370, lastbuyprice_withDiscount = 333, meanbuyprice_withDiscount = 351.5
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 185, lastbuyprice_withDiscountAndTax = 333
                where buybilldetailid = 679;
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 1833;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2848';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1833', '1', '24', '0', '107', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 09:42:45','0','0'); -- id=4659
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 ('01834', '107', '48', '1834', '24.00', '900', '21600.00', '0.00', '', '2026-10-12 12:34:18', '1834','','','0','0','0','0','0',null,'900','21600','0','0','0','0','0','0','0','0','1'); -- id=680
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1834, 0, 0
                    , 810, 24, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyprice = 810,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=859
UPDATE product SET  productBuyPrice = "900" WHERE productId = 1834 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 680 ;
UPDATE product SET productName = 'موديل بدله الاسباني', productDescription = '', productCatId = '48', productBuyPrice = '900.00', productSellAllPrice = '900.00', productSellUnitPrice = '900.00', productSellHalfPrice = '900.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01834',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '810',meanbuyprice = '900',meanbuyprice_withDiscount = '855' , productbuypricereal = '900.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='720',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='900',meanbuyprice_withTax='450',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='810',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1834';
UPDATE buybilldetail SET  lastbuyprice = 900 , meanbuyprice = 900, lastbuyprice_withDiscount = 810, meanbuyprice_withDiscount = 855
        , lastbuyprice_withTax = 900, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 810
                where buybilldetailid = 680;
UPDATE productunit SET proUnitBuyPrice  = 900 * productnumber WHERE productid = 1834;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2849';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1834', '1', '24', '0', '107', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 09:42:45','0','0'); -- id=4660
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 ('01835', '107', '48', '1835', '24.00', '900', '21600.00', '0.00', '', '2026-10-12 12:34:18', '1835','','','0','0','0','0','0',null,'900','21600','0','0','0','0','0','0','0','0','1'); -- id=681
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 09:42:45', 1, 1835, 0, 0
                    , 810, 24, 0, 0, 1, '2026-10-12 12:34:18')
                ON DUPLICATE KEY UPDATE buyprice = 810,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:34:18' ; -- id=860
UPDATE product SET  productBuyPrice = "900" WHERE productId = 1835 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 681 ;
UPDATE product SET productName = 'موديل بدله دبل الاسباني ', productDescription = '', productCatId = '48', productBuyPrice = '900.00', productSellAllPrice = '900.00', productSellUnitPrice = '900.00', productSellHalfPrice = '900.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01835',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '810',meanbuyprice = '900',meanbuyprice_withDiscount = '855' , productbuypricereal = '900.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='720',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='900',meanbuyprice_withTax='450',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='810',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1835';
UPDATE buybilldetail SET  lastbuyprice = 900 , meanbuyprice = 900, lastbuyprice_withDiscount = 810, meanbuyprice_withDiscount = 855
        , lastbuyprice_withTax = 900, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 810
                where buybilldetailid = 681;
UPDATE productunit SET proUnitBuyPrice  = 900 * productnumber WHERE productid = 1835;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2850';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1835', '1', '24', '0', '107', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 09:42:45','0','0'); -- id=4661
DELETE FROM productserial WHERE billid = 103
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '217162',suppliercurrentDebtInCurrency= '217162' , userid = '1', supplierdate = '2026-10-12 12:34:18'   WHERE supplierid = '11';
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 ('11', '119638.00', '97524', '0', 'اضافة فاتورة مشتريات', '107', '217162', '2026-10-12 12:34:18', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','86688','1','119638','97524','217162','0',''); -- id=378
UPDATE dailyentry SET totalcreditor = '86688.00', totaldebtor = '86688.00', thedate = '2026-10-12', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-12 09:47:04', entryComment = 'اضافة فاتورة مشتريات رقم 103', fromFlag = '1',related='0',isopeningentry='0',operationId='103',operationDetailLink='buyBillController.php?do=details&id=103' WHERE id = '2052';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '86688.00', '86688.00', '2026-10-12', '1', '0', '2052', '2026-10-12 12:34:18','تم عكس القيد رقم 2052 ','1','0','0','0','0',''); -- id=2090
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2090', '382', '86688.00', '','0'); -- id=2092
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19711276.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2090', '430', '86688.00', '','0'); -- id=2131
UPDATE accountstree SET name = 'الاسباني - مورد', customName = 'الاسباني - مورد', customNameEn = 'الاسباني - مورد', nameEn = 'الاسباني - مورد', parent = '81', accountNature = '1', theValue = '-19290', 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 = '430';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '97524', '97524', '2026-10-12', '1', '0', '0', '2026-10-12 12:34:18','اضافة فاتورة مشتريات رقم 107','1','0',null,'0','107','buyBillController.php?do=details&id=107'); -- id=2091
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2091', '382', '97524', '','0'); -- id=2132
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19808800.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2091', '430', '97524', '','0'); -- id=2093
UPDATE accountstree SET name = 'الاسباني - مورد', customName = 'الاسباني - مورد', customNameEn = 'الاسباني - مورد', nameEn = 'الاسباني - مورد', parent = '81', accountNature = '1', theValue = '78234', 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 = '430';
update buybill set dailyentryid='2091,0' where buybillid=107;
UPDATE product SET overAllAveragePrice = 324 WHERE productId = 1828;UPDATE product SET overAllAveragePrice = 315 WHERE productId = 1829;UPDATE product SET overAllAveragePrice = 315 WHERE productId = 1830;UPDATE product SET overAllAveragePrice = 315 WHERE productId = 1831;UPDATE product SET overAllAveragePrice = 324 WHERE productId = 1832;UPDATE product SET overAllAveragePrice = 333 WHERE productId = 1833;UPDATE product SET overAllAveragePrice = 810 WHERE productId = 1834;UPDATE product SET overAllAveragePrice = 810 WHERE productId = 1835;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:04:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:34:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 12:34:18', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=107'); -- id=7554
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:04:52";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:34:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 12:34:52', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=7555
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:05:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:35:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 12:35:16', '1', 'editbill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=106'); -- id=7556
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:05:56";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:35:56", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:35:56', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7557

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acca7bfc8364
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 12:35:56', '06acca7bfc8364', '1', '0.00', '0', '0', '1', '1980.00', '1980', '1980', '0', '1', '2026-10-12 12:35:56', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1980','0','','0','0','1980','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=425
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','425', '0', '2026-10-12 12:35:56', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1980', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 12:35:56','0','0','',''); -- id=557
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 449;
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 ('420','01597', '425', '117', '1597', '4', '495', '1980', '0', '', '0', '2026-10-12 12:35:56', '1597', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','449-4,','1','1','0','0','495','1980','0','','0','0.00','0','0','0','0'); -- id=1510
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 1510;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1597, '2026-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '59', userid = '6', storedetaildate = '2026-10-12 12:35:56' WHERE storedetailid = '1622';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1597', '1', '4', '1', '425', 'اضافة فاتورة مبيعات', 'sellbillController.php', '63', '59', '6', '2026-10-12 12:35:56','0','0'); -- id=4662
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '129830',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('127850','1980', '0', '4', 'اضافة فاتورة مبيعات', '425', '129830', '2026-10-12 12:35:56', '6',  'sellbillController.php','1','','0'); -- id=530
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1980', '1980', '2026-10-12', '6', '0', '0', '2026-10-12 12:35:56','اضافة فاتورة مبيعات رقم 425','1','0',null,'0','425','sellbillController.php?do=showDetail&sellbillid=425'); -- id=2092
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2092', '568', '1980', '','0'); -- id=2133
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '129830', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2092', '143', '1980', '','0'); -- id=2094
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4249535', 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 ( '1680', '1680', '2026-10-12', '6', '0', '0', '2026-10-12 12:35:56','اضافة فاتورة مبيعات رقم 425 - صرف البضاعة من المخزن','1','0',null,'0','425','sellbillController.php?do=showDetail&sellbillid=425'); -- id=2093
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2093', '402', '1680', '','0'); -- id=2134
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3971041.53', 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 ('2093', '382', '1680', '','0'); -- id=2095
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19807120.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='2092,0,2093' where sellbillid=425;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, 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, 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680, 1680, 1680)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1980, netSellCostBuyPrice = netSellCostBuyPrice+1680
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1680
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1680
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1680
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1680
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1680
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1680
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1680;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acca7bfc8364 and sellbillId = 425 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:05:57";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:35:57", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:35:57', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7558
UPDATE productunit SET unitid = '1', productid = '1841', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0184101',proUnitSellAllPrice='250',proUnitSellHalfPrice='250',proUnitSellUnitPrice ='250',proUnitBuyPrice='250',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1841';
UPDATE product SET productName = 'زنط مستر جيد تكس', productDescription = '', productCatId = '142', productBuyPrice = '235', productSellAllPrice = '250', productSellUnitPrice = '250', productSellHalfPrice = '250', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01841',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250.00',lastbuyprice_withDiscount = '212.5',meanbuyprice = '250.00',meanbuyprice_withDiscount = '212.5' , productbuypricereal = '250' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='212.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='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='212.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 = '1841';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:06:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:36:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 12:36:23', '1', 'update', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=7559
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 106;
UPDATE buybill SET  buybillsysdate = '2026-10-12 12:36:23', userid = '1',delbyuserid = '1', conditions = '1' WHERE buybillid = '106';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 11:54:26', 1, 1841, 0, 0
                    , 250, 216, 0, 0, 1, '2026-10-12 12:36:23')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-216, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:36:23' ; -- id=866
UPDATE buybilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 212.50, meanbuyprice_withDiscount = 212.50
        , lastbuyprice_withTax = 250.00, meanbuyprice_withTax = 250.00, lastbuyprice_withDiscountAndTax = 212.50
                where buybilldetailid = 673;
UPDATE product SET productName = 'زنط مستر جيد تكس', productDescription = '', productCatId = '142', productBuyPrice = '235.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01841',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '250',lastbuyprice_withDiscount = '0',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '250.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='212.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='250',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 = '1841';
UPDATE productunit SET proUnitBuyPrice  = 250 * productnumber WHERE productid = 1841;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '216', '1', '106', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '216', '0', '1', '2026-10-12 11:54:26','0','0'); -- id=4663
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '0' , userid = '1', supplierdate = '2026-10-12 12:36:23'   WHERE supplierid = '153';
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 ('153', '45900.00', '45900.00', '1', 'حذف فاتورة مشتريات - للتعديل', '106', '0', '2026-10-12 11:54:26', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','45900','1','45900','45900','0','0',''); -- id=379
UPDATE productserial SET del = 1
		 WHERE billid = 106;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06acca04219049', '2026-10-12 11:54:26', '153', '0.00', '50760', '0', '0', '50760.00', '50760.00', '0.00', '50760', '1', '2026-10-12 12:36:23', '', '1', '0', '', '1', '1','1','106','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=108
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 ('01841', '108', '142', '1841', '216.00', '235', '50760.00', '0.00', '', '2026-10-12 12:36:23', '1841','','','0','0','0','0','0',null,'235','50760','0','0','0','0','0','0','0','0','1'); -- id=682
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 11:54:26', 1, 1841, 0, 0
                    , 235, 216, 0, 0, 1, '2026-10-12 12:36:23')
                ON DUPLICATE KEY UPDATE buyprice = 235,
                        buyQuantity =buyQuantity+216, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:36:23' ; -- id=866
UPDATE product SET  productBuyPrice = "235" WHERE productId = 1841 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 682 ;
UPDATE product SET productName = 'زنط مستر جيد تكس', productDescription = '', productCatId = '142', productBuyPrice = '235.00', productSellAllPrice = '250.00', productSellUnitPrice = '250.00', productSellHalfPrice = '250.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01841',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235',lastbuyprice_withDiscount = '235',meanbuyprice = '235',meanbuyprice_withDiscount = '235' , productbuypricereal = '250.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='212.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='235',meanbuyprice_withTax='117.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='235',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1841';
UPDATE buybilldetail SET  lastbuyprice = 235 , meanbuyprice = 235, lastbuyprice_withDiscount = 235, meanbuyprice_withDiscount = 235
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 117.5, lastbuyprice_withDiscountAndTax = 235
                where buybilldetailid = 682;
UPDATE productunit SET proUnitBuyPrice  = 235 * productnumber WHERE productid = 1841;
UPDATE storedetail SET  productquantity = '216', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '216', '0', '108', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '216', '1', '2026-10-12 11:54:26','0','0'); -- id=4664
DELETE FROM productserial WHERE billid = 106
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '50760',suppliercurrentDebtInCurrency= '50760' , userid = '1', supplierdate = '2026-10-12 12:36:23'   WHERE supplierid = '153';
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 ('153', '0.00', '50760', '0', 'اضافة فاتورة مشتريات', '108', '50760', '2026-10-12 12:36:23', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','45900','1','0','50760','50760','0',''); -- id=380
UPDATE dailyentry SET totalcreditor = '45900.00', totaldebtor = '45900.00', thedate = '2026-10-12', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-12 11:56:07', entryComment = 'اضافة فاتورة مشتريات رقم 106', fromFlag = '1',related='0',isopeningentry='0',operationId='106',operationDetailLink='buyBillController.php?do=details&id=106' WHERE id = '2079';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '45900.00', '45900.00', '2026-10-12', '1', '0', '2079', '2026-10-12 12:36:23','تم عكس القيد رقم 2079 ','1','0','0','0','0',''); -- id=2094
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2094', '382', '45900.00', '','0'); -- id=2096
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19761220.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2094', '636', '45900.00', '','0'); -- id=2135
UPDATE accountstree SET name = 'مستر جيد تكس', customName = 'مستر جيد تكس', customNameEn = 'مستر جيد تكس', nameEn = 'مستر جيد تكس', parent = '81', accountNature = '1', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 11:54:53' WHERE id = '636';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50760', '50760', '2026-10-12', '1', '0', '0', '2026-10-12 12:36:23','اضافة فاتورة مشتريات رقم 108','1','0',null,'0','108','buyBillController.php?do=details&id=108'); -- id=2095
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2095', '382', '50760', '','0'); -- id=2136
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19811980.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2095', '636', '50760', '','0'); -- id=2097
UPDATE accountstree SET name = 'مستر جيد تكس', customName = 'مستر جيد تكس', customNameEn = 'مستر جيد تكس', nameEn = 'مستر جيد تكس', parent = '81', accountNature = '1', theValue = '50760', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 11:54:53' WHERE id = '636';
update buybill set dailyentryid='2095,0' where buybillid=108;
UPDATE product SET overAllAveragePrice = 235 WHERE productId = 1841;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:06:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:36:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 12:36:23', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=108'); -- id=7560
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:06:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:36:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 12:36:51', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=7561
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:06:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:36:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 12:36:58', '1', 'editbill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=107'); -- id=7562
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:07:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:37:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 12:37:16', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=7563
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:07:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:37:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 12:37:20', '1', 'editbill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=104'); -- id=7564
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:07:43";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:37:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 12:37:43', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7565
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:08:39";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:38:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 12:38:39', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7566
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:08:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:38:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 12:38:51', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7567
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:14:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:44:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:44:08', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7568
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:14:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:44:51", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:44:51', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7569

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acca9fd112f7
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 12:44:51', '06acca9fd112f7', '1', '0.00', '0', '0', '1', '8760.00', '8760', '8760', '0', '1', '2026-10-12 12:44:51', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '17' ,'0','','','','','-1','0','0','0','0','0','8760','0','','0','0','8760','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=426
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','426', '0', '2026-10-12 12:44:51', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '8760', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 12:44:51','0','0','',''); -- id=558
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 449;
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 ('420','01597', '426', '117', '1597', '4', '495', '1980', '0', '', '0', '2026-10-12 12:44:51', '1597', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','449-4,','1','1','0','0','495','1980','0','','0','0.00','0','0','0','0'); -- id=1511
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 1511;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1597, '2026-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1980, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-12 12:44:51' WHERE storedetailid = '1622';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1597', '1', '4', '1', '426', 'اضافة فاتورة مبيعات', 'sellbillController.php', '59', '55', '6', '2026-10-12 12:44:51','0','0'); -- id=4665
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 647;
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','01734', '426', '133', '1734', '4', '750', '3000', '0', '', '0', '2026-10-12 12:44:51', '1734', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','647-4,','1','1','0','0','750','3000','0','','0','0.00','0','0','0','0'); -- id=1512
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 = 1512;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1734, '2026-10-12', 3000, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , 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+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-10-12', 3000, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , 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 = '84', userid = '6', storedetaildate = '2026-10-12 12:44:51' WHERE storedetailid = '2747';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1734', '1', '4', '1', '426', 'اضافة فاتورة مبيعات', 'sellbillController.php', '88', '84', '6', '2026-10-12 12:44:51','0','0'); -- id=4666
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 560;
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 ('405','01696', '426', '129', '1696', '6', '450', '2700', '0', '', '0', '2026-10-12 12:44:51', '1696', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','560-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=1513
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 405.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 405
                where sellbilldetailid = 1513;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1696, '2026-10-12', 2700, 2700, 2700
                    , 2700, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2700, 2700, 2700
                    , 2700, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '129', userid = '6', storedetaildate = '2026-10-12 12:44:51' WHERE storedetailid = '2708';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1696', '1', '6', '1', '426', 'اضافة فاتورة مبيعات', 'sellbillController.php', '135', '129', '6', '2026-10-12 12:44:51','0','0'); -- id=4667
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 584;
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 ('324','01721', '426', '49', '1721', '3', '360', '1080', '0', '', '0', '2026-10-12 12:44:51', '1721', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','584-3,','1','1','0','0','360','1080','0','','0','0.00','0','0','0','0'); -- id=1514
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 324.00, meanbuyprice_withDiscount = 324.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 324
                where sellbilldetailid = 1514;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1721, '2026-10-12', 1080, 1080, 1080
                    , 1080, 972, 972, 972
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1080, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+972, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+972
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+972
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1080, 1080, 1080
                    , 1080, 972, 972, 972
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1080, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+972, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+972
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+972
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '189', userid = '6', storedetaildate = '2026-10-12 12:44:51' WHERE storedetailid = '2733';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1721', '1', '3', '1', '426', 'اضافة فاتورة مبيعات', 'sellbillController.php', '192', '189', '6', '2026-10-12 12:44:51','0','0'); -- id=4668
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '138590',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('129830','8760', '0', '4', 'اضافة فاتورة مبيعات', '426', '138590', '2026-10-12 12:44:51', '6',  'sellbillController.php','1','','0'); -- id=531
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8760', '8760', '2026-10-12', '6', '0', '0', '2026-10-12 12:44:51','اضافة فاتورة مبيعات رقم 426','1','0',null,'0','426','sellbillController.php?do=showDetail&sellbillid=426'); -- id=2096
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2096', '568', '8760', '','0'); -- id=2137
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '138590', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2096', '143', '8760', '','0'); -- id=2098
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4258295', 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 ( '8082', '8082', '2026-10-12', '6', '0', '0', '2026-10-12 12:44:51','اضافة فاتورة مبيعات رقم 426 - صرف البضاعة من المخزن','1','0',null,'0','426','sellbillController.php?do=showDetail&sellbillid=426'); -- id=2097
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2097', '402', '8082', '','0'); -- id=2138
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '3979123.53', 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 ('2097', '382', '8082', '','0'); -- id=2099
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19803898.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='2096,0,2097' where sellbillid=426;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 8760, 8460, 8460
                    , 8460, 8082, 8082, 8082
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8460, 8460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8760, sellCostBuyPrice =sellCostBuyPrice+8460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8082, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8082
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8082
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 8760, 8460, 8460
                    , 8460, 8082, 8082, 8082
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8460, 8460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8760, sellCostBuyPrice =sellCostBuyPrice+8460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8082, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8082
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8082
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8460
                        , returnSellVal = returnSellVal+0, 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, 8760, 8460, 8460
                    , 8460, 8082, 8082, 8082, 8460, 8460)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+8760, netSellCostBuyPrice = netSellCostBuyPrice+8460
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+8460
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+8460
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8082
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+8082
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+8082
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+8460
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+8460;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acca9fd112f7 and sellbillId = 426 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:14:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:44:51", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:44:51', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7570
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:24:14";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:54:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-12 12:54:14', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php'); -- id=7571
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:24:35";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:54:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-12 12:54:35', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=add'); -- id=7572
BEGIN;
CALL insertUniqueOptNum(9,1,2,1834,24,'2026-10-12',1,0, '' , '' ,0,0,0,0,0,'2026-10-12 12:54:36',0,'',0,'','hide',0,@id,@optnum);
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2849';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12', 1, 1834, 0, 0
                    , 810.00, 24, 0, 0, 1, '2026-10-12 12:54:36')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:54:36' ; -- id=859
UPDATE storemovement SET  buyPricesHistoryBookData = "24*2026-10-12*810.00," WHERE transferproductid = 27;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1834', '1', '24', '1', '27', 'تحويل منتجات من المخزن', 'storemovementController.php', '24', '0', '1', '2026-10-12','0','0'); -- id=4669
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1834', '2', '24', '1', '2026-10-12'); -- id=2857
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12', 2, 1834, 0, 0
                    , 810.00, 24, 0, 0, 1, '2026-10-12 12:54:36')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:54:36' ; -- id=886
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1834', '2', '24', '0', '27', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '24', '1', '2026-10-12','0','0'); -- id=4670
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid,expireDate,comment,maincomment,recieveType,recieveUserid,recieveTime,deloperationnum) VALUES ('1', '2', '1835', '24', '2026-10-12', '1', '0','9','0','0','2026-10-12 12:54:36','0','','0','hide','0','0','0','','','','0','0','','0'); -- id=28
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2850';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12', 1, 1835, 0, 0
                    , 810.00, 24, 0, 0, 1, '2026-10-12 12:54:36')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:54:36' ; -- id=860
UPDATE storemovement SET  buyPricesHistoryBookData = "24*2026-10-12*810.00," WHERE transferproductid = 28;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1835', '1', '24', '1', '28', 'تحويل منتجات من المخزن', 'storemovementController.php', '24', '0', '1', '2026-10-12','0','0'); -- id=4671
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1835', '2', '24', '1', '2026-10-12'); -- id=2858
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12', 2, 1835, 0, 0
                    , 810.00, 24, 0, 0, 1, '2026-10-12 12:54:36')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 12:54:36' ; -- id=888
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1835', '2', '24', '0', '28', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '24', '1', '2026-10-12','0','0'); -- id=4672
UPDATE storedetail SET inUse = 0 WHERE storedetailid=2849;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=2850;
COMMIT;
BEGIN;
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '38880', '38880', '2026-10-12', '1', '0', '0', '2026-10-12 12:54:36','تحويل من مخزن المخزن الرئيسي الى مخزن مخزن المحل','1','0',null,'0','9','storemovementController.php?do=show&operationnum=9'); -- id=2098
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2098', '492', '38880', '','0'); -- id=2139
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1149895', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2098', '382', '38880', '','0'); -- id=2100
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19765018.77', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
COMMIT;
UPDATE storemovement SET  dailyentryid =2098 WHERE operationnum = 9;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:24:36";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:54:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-12 12:54:36', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=sucess'); -- id=7573
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:24:37";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:54:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-12 12:54:37', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=show'); -- id=7574
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:27:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:57:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:57:06', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7575
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:27:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:57:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:57:15', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7576

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accabe8d81f3
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 12:57:15', '06accabe8d81f3', '1', '0.00', '0', '0', '1', '54415.00', '54415', '54415', '0', '1', '2026-10-12 12:57:15', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '114' ,'0','','','','','-1','0','0','0','0','0','54415','0','','0','0','54415','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=427
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','اضافة فاتورة مبيعات','427', '0', '2026-10-12 12:57:15', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '54415', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 12:57:15','0','0','',''); -- id=559
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 384;
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','01566', '427', '28', '1566', '5', '620', '3100', '0', '', '0', '2026-10-12 12:57:15', '1566', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','384-5,','1','1','0','0','620','3100','0','','0','0.00','0','0','0','0'); -- id=1515
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 = 1515;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1566, '2026-10-12', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 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+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , 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-10-12', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 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+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , 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 = '5', userid = '2', storedetaildate = '2026-10-12 12:57:15' WHERE storedetailid = '1591';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1566', '1', '5', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '2', '2026-10-12 12:57:15','0','0'); -- id=4673
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 ('530','09828', '427', '5', '660', '5', '550', '2750', '0', '', '0', '2026-10-12 12:57:15', '660', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','550','2750','0','','0','0.00','0','0','0','0'); -- id=1516
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 1516;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (660, '2026-10-12', 2750, 2650, 2650
                    , 2650, 2650, 2650, 2650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2650, 2650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2750, 2650, 2650
                    , 2650, 2650, 2650, 2650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2650, 2650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 12:57:15' WHERE storedetailid = '660';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('660', '1', '5', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '35', '30', '2', '2026-10-12 12:57:15','0','0'); -- id=4674
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 ('380','09457', '427', '25', '898', '5', '400', '2000', '0', '', '0', '2026-10-12 12:57:15', '898', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','400','2000','0','','0','0.00','0','0','0','0'); -- id=1517
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 1517;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (898, '2026-10-12', 2000, 1900, 1900
                    , 1900, 1900, 1900, 1900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1900, 1900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+1900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2000, 1900, 1900
                    , 1900, 1900, 1900, 1900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1900, 1900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+1900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 12:57:15' WHERE storedetailid = '898';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('898', '1', '5', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '2', '2026-10-12 12:57:15','0','0'); -- id=4675
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 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', '427', '28', '945', '5', '530', '2650', '0', '', '0', '2026-10-12 12:57:15', '945', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','24-5,','1','1','0','0','530','2650','0','','0','0.00','0','0','0','0'); -- id=1518
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 = 1518;
 INSERT INTO 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-10-12', 2650, 2550, 2550
                    , 2550, 2550, 2550, 2550
                    , 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+2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2550
                            , 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-10-12', 2650, 2550, 2550
                    , 2550, 2550, 2550, 2550
                    , 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+2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2550
                            , 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 = '10', userid = '2', storedetaildate = '2026-10-12 12:57:15' WHERE storedetailid = '945';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('945', '1', '5', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-12 12:57:15','0','0'); -- id=4676
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','08679', '427', '34', '1062', '5', '470', '2350', '0', '', '0', '2026-10-12 12:57:15', '1062', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','470','2350','0','','0','0.00','0','0','0','0'); -- id=1519
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 = 1519;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1062, '2026-10-12', 2350, 2250, 2250
                    , 2250, 2250, 2250, 2250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2250, 2250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2350, sellCostBuyPrice =sellCostBuyPrice+2250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2350, 2250, 2250
                    , 2250, 2250, 2250, 2250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2250, 2250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2350, sellCostBuyPrice =sellCostBuyPrice+2250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-12 12:57:15' WHERE storedetailid = '1062';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1062', '1', '5', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '35', '2', '2026-10-12 12:57:15','0','0'); -- id=4677
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 862;
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 ('437','01837', '427', '124', '1837', '3', '475', '1425', '0', '', '0', '2026-10-12 12:57:15', '1837', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','862-3,','1','1','0','0','475','1425','0','','0','0.00','0','0','0','0'); -- id=1520
UPDATE sellbilldetail SET  lastbuyprice = 475.00 , meanbuyprice = 475.00, lastbuyprice_withDiscount = 437.00, meanbuyprice_withDiscount = 437.00
        , lastbuyprice_withTax = 475, meanbuyprice_withTax = 475, lastbuyprice_withDiscountAndTax = 437
                where sellbilldetailid = 1520;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1837, '2026-10-12', 1425, 1425, 1425
                    , 1425, 1311, 1311, 1311
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1425, 1425, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1425, sellCostBuyPrice =sellCostBuyPrice+1425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1311, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1311
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1311
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1425
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1425, 1425, 1425
                    , 1425, 1311, 1311, 1311
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1425, 1425, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1425, sellCostBuyPrice =sellCostBuyPrice+1425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1311, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1311
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1311
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1425
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-12 12:57:15' WHERE storedetailid = '2852';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1837', '1', '3', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '27', '2', '2026-10-12 12:57:15','0','0'); -- id=4678
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 571;
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 ('432.4','01708', '427', '128', '1708', '3', '470', '1410', '0', '', '0', '2026-10-12 12:57:15', '1708', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','571-3,','1','1','0','0','470','1410','0','','0','0.00','0','0','0','0'); -- id=1521
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 432.40, meanbuyprice_withDiscount = 451.20
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 432.4
                where sellbilldetailid = 1521;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1708, '2026-10-12', 1410, 1410, 1410
                    , 1410, 1297.2, 1353.6, 1297.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1410, 705, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1410, sellCostBuyPrice =sellCostBuyPrice+1410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1297.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1353.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1297.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1410
                            , 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-10-12', 1410, 1410, 1410
                    , 1410, 1297.2, 1353.6, 1297.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1410, 705, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1410, sellCostBuyPrice =sellCostBuyPrice+1410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1297.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1353.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1297.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1410
                            , 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 = '15', userid = '2', storedetaildate = '2026-10-12 12:57:15' WHERE storedetailid = '2720';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1708', '1', '3', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '15', '2', '2026-10-12 12:57:15','0','0'); -- id=4679
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 318;
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 ('495','01540', '427', '111', '1540', '6', '550', '3300', '0', '', '0', '2026-10-12 12:57:15', '1540', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','318-6,','1','1','0','0','550','3300','0','','0','0.00','0','0','0','0'); -- id=1522
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 1522;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1540, '2026-10-12', 3300, 3300, 3300
                    , 3300, 2970, 2970, 2970
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3300, 3300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3300, sellCostBuyPrice =sellCostBuyPrice+3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2970, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2970
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2970
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3300, 3300, 3300
                    , 3300, 2970, 2970, 2970
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3300, 3300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3300, sellCostBuyPrice =sellCostBuyPrice+3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2970, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2970
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2970
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '13', userid = '2', storedetaildate = '2026-10-12 12:57:15' WHERE storedetailid = '1565';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1540', '1', '6', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19', '13', '2', '2026-10-12 12:57:15','0','0'); -- id=4680
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 332;
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 ('410','01462', '427', '103', '1462', '15', '430', '6450', '0', '', '0', '2026-10-12 12:57:15', '1462', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','332-15,','1','1','0','0','430','6450','0','','0','0.00','0','0','0','0'); -- id=1523
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 1523;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1462, '2026-10-12', 6450, 6150, 6150
                    , 6150, 6150, 6150, 6150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 6150, 6150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6450, sellCostBuyPrice =sellCostBuyPrice+6150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 6450, 6150, 6150
                    , 6150, 6150, 6150, 6150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6150, 6150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6450, sellCostBuyPrice =sellCostBuyPrice+6150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '165', userid = '2', storedetaildate = '2026-10-12 12:57:15' WHERE storedetailid = '1487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1462', '1', '15', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '180', '165', '2', '2026-10-12 12:57:15','0','0'); -- id=4681
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 767;
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 ('425','01793', '427', '138', '1793', '6', '455', '2730', '0', '', '0', '2026-10-12 12:57:15', '1793', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','767-6,','1','1','0','0','455','2730','0','','0','0.00','0','0','0','0'); -- id=1524
UPDATE sellbilldetail SET  lastbuyprice = 425.00 , meanbuyprice = 425.00, lastbuyprice_withDiscount = 425.00, meanbuyprice_withDiscount = 425.00
        , lastbuyprice_withTax = 425, meanbuyprice_withTax = 425, lastbuyprice_withDiscountAndTax = 425
                where sellbilldetailid = 1524;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1793, '2026-10-12', 2730, 2550, 2550
                    , 2550, 2550, 2550, 2550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2550, 2550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2730, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2550
                            , 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+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-10-12', 2730, 2550, 2550
                    , 2550, 2550, 2550, 2550
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2550, 2550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2730, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2550, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2550
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2550
                            , 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 = '6', userid = '2', storedetaildate = '2026-10-12 12:57:15' WHERE storedetailid = '2806';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1793', '1', '6', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '6', '2', '2026-10-12 12:57:15','0','0'); -- id=4682
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 212;
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','01431', '427', '100', '1431', '3', '540', '1620', '0', '', '0', '2026-10-12 12:57:15', '1431', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','212-3,','1','1','0','0','540','1620','0','','0','0.00','0','0','0','0'); -- id=1525
UPDATE sellbilldetail SET  lastbuyprice = 510.00 , meanbuyprice = 507.50, lastbuyprice_withDiscount = 510.00, meanbuyprice_withDiscount = 507.50
        , lastbuyprice_withTax = 507.5, meanbuyprice_withTax = 507.5, lastbuyprice_withDiscountAndTax = 510
                where sellbilldetailid = 1525;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1431, '2026-10-12', 1620, 1515, 1530
                    , 1522.5, 1530, 1522.5, 1530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1522.5, 1522.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1620, sellCostBuyPrice =sellCostBuyPrice+1515
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1522.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1522.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1522.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1522.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+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-10-12', 1620, 1515, 1530
                    , 1522.5, 1530, 1522.5, 1530
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1522.5, 1522.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1620, sellCostBuyPrice =sellCostBuyPrice+1515
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1530, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1522.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1530, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1522.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1530
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1522.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1522.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 = '9', userid = '2', storedetaildate = '2026-10-12 12:57:15' WHERE storedetailid = '1444';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1431', '1', '3', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '9', '2', '2026-10-12 12:57:15','0','0'); -- id=4683
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 766;
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 ('470','01792', '427', '138', '1792', '6', '500', '3000', '0', '', '0', '2026-10-12 12:57:15', '1792', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','766-6,','1','1','0','0','500','3000','0','','0','0.00','0','0','0','0'); -- id=1526
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 470.00, meanbuyprice_withDiscount = 470.00
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 470
                where sellbilldetailid = 1526;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1792, '2026-10-12', 3000, 2820, 2820
                    , 2820, 2820, 2820, 2820
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2820, 2820, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2820, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2820
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2820
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3000, 2820, 2820
                    , 2820, 2820, 2820, 2820
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2820, 2820, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2820, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2820
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2820
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 12:57:15' WHERE storedetailid = '2805';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1792', '1', '6', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '24', '2', '2026-10-12 12:57:15','0','0'); -- id=4684
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 252;
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 ('550','01489', '427', '107', '1489', '8', '590', '4720', '0', '', '0', '2026-10-12 12:57:15', '1489', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','252-8,','1','1','0','0','590','4720','0','','0','0.00','0','0','0','0'); -- id=1527
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 550.00, meanbuyprice_withDiscount = 550.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 550
                where sellbilldetailid = 1527;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1489, '2026-10-12', 4720, 4400, 4400
                    , 4400, 4400, 4400, 4400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 4400, 4400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4720, sellCostBuyPrice =sellCostBuyPrice+4400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 4720, 4400, 4400
                    , 4400, 4400, 4400, 4400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4400, 4400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4720, sellCostBuyPrice =sellCostBuyPrice+4400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 12:57:15' WHERE storedetailid = '1514';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1489', '1', '8', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '8', '2', '2026-10-12 12:57:15','0','0'); -- id=4685
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+7 where id = 670;
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 ('490','01756', '427', '134', '1756', '7', '510', '3570', '0', '', '0', '2026-10-12 12:57:15', '1756', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','670-7,','1','1','0','0','510','3570','0','','0','0.00','0','0','0','0'); -- id=1528
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 490.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 490
                where sellbilldetailid = 1528;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1756, '2026-10-12', 3570, 3430, 3430
                    , 3430, 3430, 3430, 3430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7, 0, 3430, 1715, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3570, sellCostBuyPrice =sellCostBuyPrice+3430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1715
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3570, 3430, 3430
                    , 3430, 3430, 3430, 3430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3430, 1715, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3570, sellCostBuyPrice =sellCostBuyPrice+3430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1715
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 12:57:15' WHERE storedetailid = '2769';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1756', '1', '7', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '5', '2', '2026-10-12 12:57:15','0','0'); -- id=4686
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 861;
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 ('515.2','01836', '427', '124', '1836', '6', '560', '3360', '0', '', '0', '2026-10-12 12:57:15', '1836', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','861-6,','1','1','0','0','560','3360','0','','0','0.00','0','0','0','0'); -- id=1529
UPDATE sellbilldetail SET  lastbuyprice = 560.00 , meanbuyprice = 560.00, lastbuyprice_withDiscount = 515.20, meanbuyprice_withDiscount = 515.20
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 515.2
                where sellbilldetailid = 1529;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1836, '2026-10-12', 3360, 3360, 3360
                    , 3360, 3091.2, 3091.2, 3091.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3360, 3360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3360, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3091.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3091.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3091.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3360, 3360, 3360
                    , 3360, 3091.2, 3091.2, 3091.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3360, 3360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3360, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3091.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3091.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3091.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-12 12:57:15' WHERE storedetailid = '2851';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1836', '1', '6', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '27', '2', '2026-10-12 12:57:15','0','0'); -- id=4687
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 317;
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 ('477','01539', '427', '111', '1539', '6', '530', '3180', '0', '', '0', '2026-10-12 12:57:15', '1539', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','317-6,','1','1','0','0','530','3180','0','','0','0.00','0','0','0','0'); -- id=1530
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 477.00, meanbuyprice_withDiscount = 477.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 477
                where sellbilldetailid = 1530;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1539, '2026-10-12', 3180, 3180, 3180
                    , 3180, 2862, 2862, 2862
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3180, 3180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3180, sellCostBuyPrice =sellCostBuyPrice+3180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2862, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2862
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2862
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3180, 3180, 3180
                    , 3180, 2862, 2862, 2862
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3180, 3180, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3180, sellCostBuyPrice =sellCostBuyPrice+3180
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3180, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2862, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2862
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2862
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3180
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3180
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '2', storedetaildate = '2026-10-12 12:57:15' WHERE storedetailid = '1564';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1539', '1', '6', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22', '16', '2', '2026-10-12 12:57:15','0','0'); -- id=4688
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 355;
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 ('276','01467', '427', '104', '1467', '20', '340', '6800', '0', '', '0', '2026-10-12 12:57:15', '1467', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','355-20,','1','1','0','0','340','6800','0','','0','0.00','0','0','0','0'); -- id=1531
UPDATE sellbilldetail SET  lastbuyprice = 276.00 , meanbuyprice = 276.00, lastbuyprice_withDiscount = 276.00, meanbuyprice_withDiscount = 276.00
        , lastbuyprice_withTax = 276, meanbuyprice_withTax = 276, lastbuyprice_withDiscountAndTax = 276
                where sellbilldetailid = 1531;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1467, '2026-10-12', 6800, 5520, 5520
                    , 5520, 5520, 5520, 5520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 5520, 5520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6800, sellCostBuyPrice =sellCostBuyPrice+5520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 6800, 5520, 5520
                    , 5520, 5520, 5520, 5520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5520, 5520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6800, sellCostBuyPrice =sellCostBuyPrice+5520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '600', userid = '2', storedetaildate = '2026-10-12 12:57:15' WHERE storedetailid = '1492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '20', '1', '427', 'اضافة فاتورة مبيعات', 'sellbillController.php', '620', '600', '2', '2026-10-12 12:57:15','0','0'); -- id=4689
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2490870',  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 ('2436455','54415', '0', '2', 'اضافة فاتورة مبيعات', '427', '2490870', '2026-10-12 12:57:15', '2',  'sellbillController.php','1','','0'); -- id=532
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '54415', '54415', '2026-10-12', '2', '0', '0', '2026-10-12 12:57:15','اضافة فاتورة مبيعات رقم 427','1','0',null,'0','427','sellbillController.php?do=showDetail&sellbillid=427'); -- id=2099
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2099', '419', '54415', '','0'); -- id=2140
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2490870', 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 ('2099', '143', '54415', '','0'); -- id=2101
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4312710', 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 ( '50281.4', '50281.4', '2026-10-12', '2', '0', '0', '2026-10-12 12:57:15','اضافة فاتورة مبيعات رقم 427 - صرف البضاعة من المخزن','1','0',null,'0','427','sellbillController.php?do=showDetail&sellbillid=427'); -- id=2100
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2100', '402', '50281.4', '','0'); -- id=2141
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4029404.93', 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 ('2100', '382', '50281.4', '','0'); -- id=2102
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19714737.37', 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='2099,0,2100' where sellbillid=427;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 54415, 51410, 51425
                    , 51417.5, 50281.4, 50330.3, 50281.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,51417.5, 48997.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+54415, sellCostBuyPrice =sellCostBuyPrice+51410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+51425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+51417.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+50281.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+50330.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+50281.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+51417.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+48997.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 (1, '2026-10-12', 54415, 51410, 51425
                    , 51417.5, 50281.4, 50330.3, 50281.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,51417.5, 48997.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+54415, sellCostBuyPrice =sellCostBuyPrice+51410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+51425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+51417.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+50281.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+50330.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+50281.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+51417.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+48997.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, 54415, 51410, 51425
                    , 51417.5, 50281.4, 50330.3, 50281.4, 51417.5, 48997.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+54415, netSellCostBuyPrice = netSellCostBuyPrice+51410
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+51425
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+51417.5
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+50281.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+50330.3
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+50281.4
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+51417.5
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+48997.5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accabe8d81f3 and sellbillId = 427 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:27:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:57:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 12:57:15', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7577
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:27:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:57:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 12:57:38', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7578
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:28:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:58:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 12:58:15', '1', 'add2', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=7579
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-10-12','','90', '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=143
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (143, 1,'2026-10-12 12:58:15',1)
                ON DUPLICATE KEY UPDATE catid = 143, edited = 1, sysdate = '2026-10-12 12:58:15', userid = 1; -- id=155
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:28:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:58:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 12:58:16', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=7580
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:28:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:58:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 12:58:17', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=7581
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:28:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 12:58:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 12:58:20', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7582
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:30:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:00:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:00:33', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7583

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accaefb6a283
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 13:00:33', '06accaefb6a283', '1', '0.00', '0', '0', '1', '8180.00', '8180', '8180', '0', '1', '2026-10-12 13:00:33', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '23' ,'0','','','','','-1','0','0','0','0','0','8180','0','','0','0','8180','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=428
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','اضافة فاتورة مبيعات','428', '0', '2026-10-12 13:00:33', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '8180', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 13:00:33','0','0','',''); -- id=560
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 559;
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 ('386.4','01695', '428', '127', '1695', '6', '420', '2520', '0', '', '0', '2026-10-12 13:00:33', '1695', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','559-6,','1','1','0','0','420','2520','0','','0','0.00','0','0','0','0'); -- id=1532
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 386.40, meanbuyprice_withDiscount = 386.40
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 386.4
                where sellbilldetailid = 1532;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1695, '2026-10-12', 2520, 2520, 2520
                    , 2520, 2318.4, 2318.4, 2318.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2520, 2520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2520, sellCostBuyPrice =sellCostBuyPrice+2520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2318.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2318.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2318.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2520, 2520, 2520
                    , 2520, 2318.4, 2318.4, 2318.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2520, 2520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2520, sellCostBuyPrice =sellCostBuyPrice+2520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2318.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2318.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2318.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '102', userid = '2', storedetaildate = '2026-10-12 13:00:33' WHERE storedetailid = '2707';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1695', '1', '6', '1', '428', 'اضافة فاتورة مبيعات', 'sellbillController.php', '108', '102', '2', '2026-10-12 13:00:33','0','0'); -- id=4690
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 354;
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','01466', '428', '104', '1466', '8', '370', '2960', '0', '', '0', '2026-10-12 13:00:33', '1466', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','354-8,','1','1','0','0','370','2960','0','','0','0.00','0','0','0','0'); -- id=1533
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 = 1533;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1466, '2026-10-12', 2960, 2400, 2400
                    , 2400, 2400, 2400, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2960, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2960, 2400, 2400
                    , 2400, 2400, 2400, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2960, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '416', userid = '2', storedetaildate = '2026-10-12 13:00:33' WHERE storedetailid = '1491';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1466', '1', '8', '1', '428', 'اضافة فاتورة مبيعات', 'sellbillController.php', '424', '416', '2', '2026-10-12 13:00:33','0','0'); -- id=4691
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 71;
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 ('270','01379', '428', '94', '1379', '9', '300', '2700', '0', '', '0', '2026-10-12 13:00:33', '1379', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','71-9,','1','1','0','0','300','2700','0','','0','0.00','0','0','0','0'); -- id=1534
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 1534;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1379, '2026-10-12', 2700, 2430, 2430
                    , 2430, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2430, 2430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2700, 2430, 2430
                    , 2430, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2430, 2430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '561', userid = '2', storedetaildate = '2026-10-12 13:00:33' WHERE storedetailid = '1379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1379', '1', '9', '1', '428', 'اضافة فاتورة مبيعات', 'sellbillController.php', '570', '561', '2', '2026-10-12 13:00:33','0','0'); -- id=4692
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2499050',  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 ('2490870','8180', '0', '2', 'اضافة فاتورة مبيعات', '428', '2499050', '2026-10-12 13:00:33', '2',  'sellbillController.php','1','','0'); -- id=533
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8180', '8180', '2026-10-12', '2', '0', '0', '2026-10-12 13:00:33','اضافة فاتورة مبيعات رقم 428','1','0',null,'0','428','sellbillController.php?do=showDetail&sellbillid=428'); -- id=2101
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2101', '419', '8180', '','0'); -- id=2142
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2499050', 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 ('2101', '143', '8180', '','0'); -- id=2103
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4320890', 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 ( '7148.4', '7148.4', '2026-10-12', '2', '0', '0', '2026-10-12 13:00:33','اضافة فاتورة مبيعات رقم 428 - صرف البضاعة من المخزن','1','0',null,'0','428','sellbillController.php?do=showDetail&sellbillid=428'); -- id=2102
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2102', '402', '7148.4', '','0'); -- id=2143
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4036553.33', 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 ('2102', '382', '7148.4', '','0'); -- id=2104
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19707588.97', 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='2101,0,2102' where sellbillid=428;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 8180, 7350, 7350
                    , 7350, 7148.4, 7148.4, 7148.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7350, 7350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8180, sellCostBuyPrice =sellCostBuyPrice+7350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7148.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7148.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7148.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 8180, 7350, 7350
                    , 7350, 7148.4, 7148.4, 7148.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7350, 7350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8180, sellCostBuyPrice =sellCostBuyPrice+7350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7148.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7148.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7148.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7350
                        , returnSellVal = returnSellVal+0, 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, 8180, 7350, 7350
                    , 7350, 7148.4, 7148.4, 7148.4, 7350, 7350)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+8180, netSellCostBuyPrice = netSellCostBuyPrice+7350
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+7350
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+7350
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+7148.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+7148.4
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+7148.4
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+7350
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+7350;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accaefb6a283 and sellbillId = 428 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:30:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:00:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:00:33', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7584
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:35:25";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:05:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:05:25', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=7585
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:35:35";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:05:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:05:35', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=7586
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:38:43";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:08:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:08:43', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=7587
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 ('جاكيت 140 او ار ','','143','740','770','770','770','2026-10-12','0','1','0','','0','0','0','0','0','740','740','740','740','740','0','4.05','0','0','.','0','0','0','740','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','740','740','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','740','0','0','0','0','0','0','','','0','0','0','0'); -- id=1842
UPDATE product SET productName = 'جاكيت 140 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740', productSellAllPrice = '770', productSellUnitPrice = '770', productSellHalfPrice = '770', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01842',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740' , buypricereal_precentage = '0' , buytotal_precentage = '4.05' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1842';
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', '1842', '1', '2026-10-12', '1', '0','0184201','770','770','770','740','','0','0','0','0','0','0','0','0','0','0'); -- id=1842
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1842', '1', '0', '1', '2026-10-12'); -- id=2859
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1842', '1', '0', '0', '1842', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4693
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1842, 1,'2026-10-12 13:08:43',1)
                ON DUPLICATE KEY UPDATE productid = 1842, edited = 1, sysdate = '2026-10-12 13:08:43', userid = 1; -- id=2764
UPDATE product SET productName = 'جاكيت 140 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01842',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740' , buypricereal_precentage = '0' , buytotal_precentage = '4.05' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1842';
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 ('جاكيت 362 او ار','','143','740','770','770','770','2026-10-12','0','1','0','','0','0','0','0','0','740','740','740','740','740','0','4.05','0','0','.','0','0','0','740','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','740','740','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','740','0','0','0','0','0','0','','','0','0','0','0'); -- id=1843
UPDATE product SET productName = 'جاكيت 362 او ار', productDescription = '', productCatId = '143', productBuyPrice = '740', productSellAllPrice = '770', productSellUnitPrice = '770', productSellHalfPrice = '770', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01843',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740' , buypricereal_precentage = '0' , buytotal_precentage = '4.05' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1843';
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', '1843', '1', '2026-10-12', '1', '0','0184301','770','770','770','740','','0','0','0','0','0','0','0','0','0','0'); -- id=1843
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1843', '1', '0', '1', '2026-10-12'); -- id=2860
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1843', '1', '0', '0', '1843', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4694
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1843, 1,'2026-10-12 13:08:43',1)
                ON DUPLICATE KEY UPDATE productid = 1843, edited = 1, sysdate = '2026-10-12 13:08:43', userid = 1; -- id=2765
UPDATE product SET productName = 'جاكيت 362 او ار', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01843',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740' , buypricereal_precentage = '0' , buytotal_precentage = '4.05' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1843';
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 ('جاكيت 333 او ار','','143','770','800','800','800','2026-10-12','0','1','0','','0','0','0','0','0','770','770','770','770','770','0','3.9','0','0','.','0','0','0','770','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','770','770','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','770','0','0','0','0','0','0','','','0','0','0','0'); -- id=1844
UPDATE product SET productName = 'جاكيت 333 او ار', productDescription = '', productCatId = '143', productBuyPrice = '770', productSellAllPrice = '800', productSellUnitPrice = '800', productSellHalfPrice = '800', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01844',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '770',lastbuyprice_withDiscount = '770',meanbuyprice = '770',meanbuyprice_withDiscount = '770' , productbuypricereal = '770' , buypricereal_precentage = '0' , buytotal_precentage = '3.9' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='770',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='770',meanbuyprice_withTax='770',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='770',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1844';
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', '1844', '1', '2026-10-12', '1', '0','0184401','800','800','800','770','','0','0','0','0','0','0','0','0','0','0'); -- id=1844
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1844', '1', '0', '1', '2026-10-12'); -- id=2861
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1844', '1', '0', '0', '1844', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4695
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1844, 1,'2026-10-12 13:08:43',1)
                ON DUPLICATE KEY UPDATE productid = 1844, edited = 1, sysdate = '2026-10-12 13:08:43', userid = 1; -- id=2766
UPDATE product SET productName = 'جاكيت 333 او ار', productDescription = '', productCatId = '143', productBuyPrice = '770.00', productSellAllPrice = '800.00', productSellUnitPrice = '800.00', productSellHalfPrice = '800.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01844',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '770',lastbuyprice_withDiscount = '770',meanbuyprice = '770',meanbuyprice_withDiscount = '770' , productbuypricereal = '770' , buypricereal_precentage = '0' , buytotal_precentage = '3.9' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='770',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='770',meanbuyprice_withTax='770',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='770',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1844';
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 ('جاكيت استرس او ار ','','143','740','770','770','770','2026-10-12','0','1','0','','0','0','0','0','0','740','740','740','740','740','0','4.05','0','0','.','0','0','0','740','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','740','740','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','740','0','0','0','0','0','0','','','0','0','0','0'); -- id=1845
UPDATE product SET productName = 'جاكيت استرس او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740', productSellAllPrice = '770', productSellUnitPrice = '770', productSellHalfPrice = '770', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01845',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740' , buypricereal_precentage = '0' , buytotal_precentage = '4.05' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1845';
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', '1845', '1', '2026-10-12', '1', '0','0184501','770','770','770','740','','0','0','0','0','0','0','0','0','0','0'); -- id=1845
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1845', '1', '0', '1', '2026-10-12'); -- id=2862
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1845', '1', '0', '0', '1845', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4696
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1845, 1,'2026-10-12 13:08:43',1)
                ON DUPLICATE KEY UPDATE productid = 1845, edited = 1, sysdate = '2026-10-12 13:08:43', userid = 1; -- id=2767
UPDATE product SET productName = 'جاكيت استرس او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01845',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740' , buypricereal_precentage = '0' , buytotal_precentage = '4.05' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1845';
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 ('جاكيت 14054 او ار','','143','600','630','630','630','2026-10-12','0','1','0','','0','0','0','0','0','600','600','600','600','600','0','5','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=1846
UPDATE product SET productName = 'جاكيت 14054 او ار', productDescription = '', productCatId = '143', productBuyPrice = '600', productSellAllPrice = '630', productSellUnitPrice = '630', productSellHalfPrice = '630', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01846',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 = '5' , 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 = '1846';
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', '1846', '1', '2026-10-12', '1', '0','0184601','630','630','630','600','','0','0','0','0','0','0','0','0','0','0'); -- id=1846
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1846', '1', '0', '1', '2026-10-12'); -- id=2863
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1846', '1', '0', '0', '1846', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4697
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1846, 1,'2026-10-12 13:08:43',1)
                ON DUPLICATE KEY UPDATE productid = 1846, edited = 1, sysdate = '2026-10-12 13:08:43', userid = 1; -- id=2768
UPDATE product SET productName = 'جاكيت 14054 او ار', productDescription = '', productCatId = '143', productBuyPrice = '600.00', productSellAllPrice = '630.00', productSellUnitPrice = '630.00', productSellHalfPrice = '630.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01846',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 = '5' , 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 = '1846';
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 ('جاكيت 103 او ار','','143','750','780','780','780','2026-10-12','0','1','0','','0','0','0','0','0','750','750','750','750','750','0','4','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=1847
UPDATE product SET productName = 'جاكيت 103 او ار', productDescription = '', productCatId = '143', productBuyPrice = '750', productSellAllPrice = '780', productSellUnitPrice = '780', productSellHalfPrice = '780', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01847',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 = '4' , 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 = '1847';
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', '1847', '1', '2026-10-12', '1', '0','0184701','780','780','780','750','','0','0','0','0','0','0','0','0','0','0'); -- id=1847
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1847', '1', '0', '1', '2026-10-12'); -- id=2864
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1847', '1', '0', '0', '1847', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4698
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1847, 1,'2026-10-12 13:08:43',1)
                ON DUPLICATE KEY UPDATE productid = 1847, edited = 1, sysdate = '2026-10-12 13:08:43', userid = 1; -- id=2769
UPDATE product SET productName = 'جاكيت 103 او ار', productDescription = '', productCatId = '143', productBuyPrice = '750.00', productSellAllPrice = '780.00', productSellUnitPrice = '780.00', productSellHalfPrice = '780.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01847',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 = '4' , 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 = '1847';
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 ('جاكيت 365 او ار ','','143','750','780','780','780','2026-10-12','0','1','0','','0','0','0','0','0','750','750','750','750','750','0','4','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=1848
UPDATE product SET productName = 'جاكيت 365 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '750', productSellAllPrice = '780', productSellUnitPrice = '780', productSellHalfPrice = '780', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01848',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 = '4' , 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 = '1848';
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', '1848', '1', '2026-10-12', '1', '0','0184801','780','780','780','750','','0','0','0','0','0','0','0','0','0','0'); -- id=1848
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1848', '1', '0', '1', '2026-10-12'); -- id=2865
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1848', '1', '0', '0', '1848', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4699
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1848, 1,'2026-10-12 13:08:43',1)
                ON DUPLICATE KEY UPDATE productid = 1848, edited = 1, sysdate = '2026-10-12 13:08:43', userid = 1; -- id=2770
UPDATE product SET productName = 'جاكيت 365 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '750.00', productSellAllPrice = '780.00', productSellUnitPrice = '780.00', productSellHalfPrice = '780.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01848',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 = '4' , 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 = '1848';
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 ('جاكيت 2003 او ار ','','143','650','680','680','680','2026-10-12','0','1','0','','0','0','0','0','0','650','650','650','650','650','0','4.62','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=1849
UPDATE product SET productName = 'جاكيت 2003 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '650', productSellAllPrice = '680', productSellUnitPrice = '680', productSellHalfPrice = '680', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01849',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 = '4.62' , 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 = '1849';
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', '1849', '1', '2026-10-12', '1', '0','0184901','680','680','680','650','','0','0','0','0','0','0','0','0','0','0'); -- id=1849
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1849', '1', '0', '1', '2026-10-12'); -- id=2866
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1849', '1', '0', '0', '1849', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4700
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1849, 1,'2026-10-12 13:08:43',1)
                ON DUPLICATE KEY UPDATE productid = 1849, edited = 1, sysdate = '2026-10-12 13:08:43', userid = 1; -- id=2771
UPDATE product SET productName = 'جاكيت 2003 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '650.00', productSellAllPrice = '680.00', productSellUnitPrice = '680.00', productSellHalfPrice = '680.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01849',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 = '4.62' , 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 = '1849';
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 ('جاكيت 2001 او ار','','143','740','770','770','770','2026-10-12','0','1','0','','0','0','0','0','0','740','740','740','740','740','0','4.05','0','0','.','0','0','0','740','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','740','740','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','740','0','0','0','0','0','0','','','0','0','0','0'); -- id=1850
UPDATE product SET productName = 'جاكيت 2001 او ار', productDescription = '', productCatId = '143', productBuyPrice = '740', productSellAllPrice = '770', productSellUnitPrice = '770', productSellHalfPrice = '770', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01850',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740' , buypricereal_precentage = '0' , buytotal_precentage = '4.05' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1850';
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', '1850', '1', '2026-10-12', '1', '0','0185001','770','770','770','740','','0','0','0','0','0','0','0','0','0','0'); -- id=1850
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1850', '1', '0', '1', '2026-10-12'); -- id=2867
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1850', '1', '0', '0', '1850', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4701
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1850, 1,'2026-10-12 13:08:43',1)
                ON DUPLICATE KEY UPDATE productid = 1850, edited = 1, sysdate = '2026-10-12 13:08:43', userid = 1; -- id=2772
UPDATE product SET productName = 'جاكيت 2001 او ار', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01850',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740' , buypricereal_precentage = '0' , buytotal_precentage = '4.05' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1850';
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 او ار ','','143','740','770','770','770','2026-10-12','0','1','0','','0','0','0','0','0','740','740','740','740','740','0','4.05','0','0','.','0','0','0','740','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','740','740','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','740','0','0','0','0','0','0','','','0','0','0','0'); -- id=1851
UPDATE product SET productName = 'جاكيت 2002 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740', productSellAllPrice = '770', productSellUnitPrice = '770', productSellHalfPrice = '770', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01851',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740' , buypricereal_precentage = '0' , buytotal_precentage = '4.05' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1851';
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', '1851', '1', '2026-10-12', '1', '0','0185101','770','770','770','740','','0','0','0','0','0','0','0','0','0','0'); -- id=1851
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1851', '1', '0', '1', '2026-10-12'); -- id=2868
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1851', '1', '0', '0', '1851', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4702
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1851, 1,'2026-10-12 13:08:43',1)
                ON DUPLICATE KEY UPDATE productid = 1851, edited = 1, sysdate = '2026-10-12 13:08:43', userid = 1; -- id=2773
UPDATE product SET productName = 'جاكيت 2002 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01851',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740' , buypricereal_precentage = '0' , buytotal_precentage = '4.05' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1851';
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 ('جاكيت 308 او ار ','','143','750','780','780','780','2026-10-12','0','1','0','','0','0','0','0','0','750','750','750','750','750','0','4','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=1852
UPDATE product SET productName = 'جاكيت 308 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '750', productSellAllPrice = '780', productSellUnitPrice = '780', productSellHalfPrice = '780', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01852',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 = '4' , 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 = '1852';
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', '1852', '1', '2026-10-12', '1', '0','0185201','780','780','780','750','','0','0','0','0','0','0','0','0','0','0'); -- id=1852
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1852', '1', '0', '1', '2026-10-12'); -- id=2869
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1852', '1', '0', '0', '1852', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4703
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1852, 1,'2026-10-12 13:08:43',1)
                ON DUPLICATE KEY UPDATE productid = 1852, edited = 1, sysdate = '2026-10-12 13:08:43', userid = 1; -- id=2774
UPDATE product SET productName = 'جاكيت 308 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '750.00', productSellAllPrice = '780.00', productSellUnitPrice = '780.00', productSellHalfPrice = '780.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01852',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 = '4' , 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 = '1852';
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 ('جاكيت 2013 او ار ','','143','730','760','760','760','2026-10-12','0','1','0','','0','0','0','0','0','730','730','730','730','730','0','4.11','0','0','.','0','0','0','730','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','730','730','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','730','0','0','0','0','0','0','','','0','0','0','0'); -- id=1853
UPDATE product SET productName = 'جاكيت 2013 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '730', productSellAllPrice = '760', productSellUnitPrice = '760', productSellHalfPrice = '760', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01853',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '730',lastbuyprice_withDiscount = '730',meanbuyprice = '730',meanbuyprice_withDiscount = '730' , productbuypricereal = '730' , buypricereal_precentage = '0' , buytotal_precentage = '4.11' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='730',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='730',meanbuyprice_withTax='730',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='730',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1853';
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', '1853', '1', '2026-10-12', '1', '0','0185301','760','760','760','730','','0','0','0','0','0','0','0','0','0','0'); -- id=1853
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1853', '1', '0', '1', '2026-10-12'); -- id=2870
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1853', '1', '0', '0', '1853', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4704
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1853, 1,'2026-10-12 13:08:43',1)
                ON DUPLICATE KEY UPDATE productid = 1853, edited = 1, sysdate = '2026-10-12 13:08:43', userid = 1; -- id=2775
UPDATE product SET productName = 'جاكيت 2013 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '730.00', productSellAllPrice = '760.00', productSellUnitPrice = '760.00', productSellHalfPrice = '760.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01853',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '730',lastbuyprice_withDiscount = '730',meanbuyprice = '730',meanbuyprice_withDiscount = '730' , productbuypricereal = '730' , buypricereal_precentage = '0' , buytotal_precentage = '4.11' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='730',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='730',meanbuyprice_withTax='730',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='730',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1853';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:38:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:08:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:08:45', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7588
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:38:47";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:08:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:08:47', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7589
UPDATE supplier SET suppliername = '', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '', supplierdetails = '', conditions = null, userid = null, supplierdate = '', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='-1',sullpierCurrencyid='0',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = null;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:42:11";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:12:11", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:12:11', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7590
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:42:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:12:17", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:12:17', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7591
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:44:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:14:41", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:14:41', '4', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7592

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accb2818f98d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 13:14:41', '06accb2818f98d', '1', '0.00', '0', '0', '1', '5460.00', '5460', '5460', '0', '2', '2026-10-12 13:14:41', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '14' ,'0','','','','','-1','0','0','0','0','0','5460','0','','0','0','5460','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=429
UPDATE client SET  clientdebt = '0', userid = '4' 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','اضافة فاتورة مبيعات','429', '0', '2026-10-12 13:14:41', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5460', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 13:14:41','0','0','',''); -- id=561
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+14 where id = 131;
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','01324', '429', '86', '1324', '14', '390', '5460', '0', '', '0', '2026-10-12 13:14:41', '1324', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','131-14,','1','1','0','0','390','5460','0','','0','0.00','0','0','0','0'); -- id=1535
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 355.63, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 355.63
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 355.63, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 1535;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1324, '2026-10-12', 5460, 5040, 5040
                    , 4978.82, 5040, 4978.82, 4972.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 14, 0, 5040, 4978.82, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5460, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4978.82
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4978.82
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4972.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4978.82
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (2, '2026-10-12', 5460, 5040, 5040
                    , 4978.82, 5040, 4978.82, 4972.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5040, 4978.82, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5460, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4978.82
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4978.82
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4972.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4978.82
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1506', userid = '4', storedetaildate = '2026-10-12 13:14:41' WHERE storedetailid = '1405';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1324', '2', '14', '1', '429', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1520', '1506', '4', '2026-10-12 13:14:41','0','0'); -- id=4705
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '503500',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('498040','5460', '0', '3', 'اضافة فاتورة مبيعات', '429', '503500', '2026-10-12 13:14:41', '4',  'sellbillController.php','1','','0'); -- id=534
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5460', '5460', '2026-10-12', '4', '0', '0', '2026-10-12 13:14:41','اضافة فاتورة مبيعات رقم 429','1','0',null,'0','429','sellbillController.php?do=showDetail&sellbillid=429'); -- id=2103
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2103', '501', '5460', '','0'); -- id=2144
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '503500', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2103', '143', '5460', '','0'); -- id=2105
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4326350', 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 ( '5040', '5040', '2026-10-12', '4', '0', '0', '2026-10-12 13:14:41','اضافة فاتورة مبيعات رقم 429 - صرف البضاعة من المخزن','1','0',null,'0','429','sellbillController.php?do=showDetail&sellbillid=429'); -- id=2104
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2104', '402', '5040', '','0'); -- id=2145
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4041593.33', 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 ('2104', '492', '5040', '','0'); -- id=2106
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1144855', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='2103,0,2104' where sellbillid=429;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 5460, 5040, 5040
                    , 4978.82, 5040, 4978.82, 4972.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5040, 4978.82, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5460, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4978.82
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4978.82
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4972.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4978.82
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 5460, 5040, 5040
                    , 4978.82, 5040, 4978.82, 4972.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5040, 4978.82, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5460, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4978.82
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4978.82
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4972.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4978.82
                        , returnSellVal = returnSellVal+0, 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, 5460, 5040, 5040
                    , 4978.82, 5040, 4978.82, 4972.8, 5040, 4978.82)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5460, netSellCostBuyPrice = netSellCostBuyPrice+5040
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+5040
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4978.82
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5040
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4978.82
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4972.8
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+5040
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4978.82;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accb2818f98d and sellbillId = 429 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:44:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:14:42", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:14:42', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7593
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:45:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:15:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:15:02', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7594
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:45:10";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:15:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:15:10', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7595
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:45:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:15:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:15:15', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7596

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accafc1a7ee3
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 13:15:15', '06accafc1a7ee3', '1', '0.00', '0', '0', '1', '3150.00', '3150', '3150', '0', '1', '2026-10-12 13:15:15', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '9' ,'0','','','','','-1','0','0','0','0','0','3150','0','','0','0','3150','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=430
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','اضافة فاتورة مبيعات','430', '0', '2026-10-12 13:15:15', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3150', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 13:15:15','0','0','',''); -- id=562
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 74;
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','01382', '430', '94', '1382', '6', '400', '2400', '0', '', '0', '2026-10-12 13:15:15', '1382', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','74-6,','1','1','0','0','400','2400','0','','0','0.00','0','0','0','0'); -- id=1536
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 = 1536;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1382, '2026-10-12', 2400, 2160, 2160
                    , 2160, 2160, 2160, 2160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2160, 2160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2400, 2160, 2160
                    , 2160, 2160, 2160, 2160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2160, 2160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 13:15:15' WHERE storedetailid = '1382';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1382', '1', '6', '1', '430', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '18', '2', '2026-10-12 13:15:15','0','0'); -- id=4706
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 866;
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','01841', '430', '142', '1841', '3', '250', '750', '0', '', '0', '2026-10-12 13:15:15', '1841', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','866-3,','1','1','0','0','250','750','0','','0','0.00','0','0','0','0'); -- id=1537
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 117.5, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 1537;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1841, '2026-10-12', 750, 705, 705
                    , 705, 705, 705, 705
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 705, 352.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+705
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+705, sellCostMeanBuyPrice = sellCostMeanBuyPrice+705
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+705, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+705
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+705
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+705
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+352.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+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-10-12', 750, 705, 705
                    , 705, 705, 705, 705
                    , 0, 0, 0, 0
                    , 0, 0, 0, 705, 352.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+705
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+705, sellCostMeanBuyPrice = sellCostMeanBuyPrice+705
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+705, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+705
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+705
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+705
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+352.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 = '213', userid = '2', storedetaildate = '2026-10-12 13:15:15' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '3', '1', '430', 'اضافة فاتورة مبيعات', 'sellbillController.php', '216', '213', '2', '2026-10-12 13:15:15','0','0'); -- id=4707
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2502200',  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 ('2499050','3150', '0', '2', 'اضافة فاتورة مبيعات', '430', '2502200', '2026-10-12 13:15:15', '2',  'sellbillController.php','1','','0'); -- id=535
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3150', '3150', '2026-10-12', '2', '0', '0', '2026-10-12 13:15:15','اضافة فاتورة مبيعات رقم 430','1','0',null,'0','430','sellbillController.php?do=showDetail&sellbillid=430'); -- id=2105
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2105', '419', '3150', '','0'); -- id=2146
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2502200', 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 ('2105', '143', '3150', '','0'); -- id=2107
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4329500', 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 ( '2865', '2865', '2026-10-12', '2', '0', '0', '2026-10-12 13:15:15','اضافة فاتورة مبيعات رقم 430 - صرف البضاعة من المخزن','1','0',null,'0','430','sellbillController.php?do=showDetail&sellbillid=430'); -- id=2106
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2106', '402', '2865', '','0'); -- id=2147
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4044458.33', 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 ('2106', '382', '2865', '','0'); -- id=2108
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19704723.97', 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='2105,0,2106' where sellbillid=430;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 3150, 2865, 2865
                    , 2865, 2865, 2865, 2865
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2865, 2512.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3150, sellCostBuyPrice =sellCostBuyPrice+2865
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2865, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2865
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2865, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2865
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2865
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2865
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2512.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 (1, '2026-10-12', 3150, 2865, 2865
                    , 2865, 2865, 2865, 2865
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2865, 2512.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3150, sellCostBuyPrice =sellCostBuyPrice+2865
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2865, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2865
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2865, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2865
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2865
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2865
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2512.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, 3150, 2865, 2865
                    , 2865, 2865, 2865, 2865, 2865, 2512.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3150, netSellCostBuyPrice = netSellCostBuyPrice+2865
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2865
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2865
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2865
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2865
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2865
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2865
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2512.5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accafc1a7ee3 and sellbillId = 430 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:45:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:15:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:15:15', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7597
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:46:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:16:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:16:08', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=7598
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 ('جاكيت 599 او ار','','143','780','810','810','810','2026-10-12','0','1','0','','0','0','0','0','0','780','780','780','780','780','0','3.85','0','0','.','0','0','0','780','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','780','780','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','780','0','0','0','0','0','0','','','0','0','0','0'); -- id=1854
UPDATE product SET productName = 'جاكيت 599 او ار', productDescription = '', productCatId = '143', productBuyPrice = '780', productSellAllPrice = '810', productSellUnitPrice = '810', productSellHalfPrice = '810', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01854',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '780',lastbuyprice_withDiscount = '780',meanbuyprice = '780',meanbuyprice_withDiscount = '780' , productbuypricereal = '780' , buypricereal_precentage = '0' , buytotal_precentage = '3.85' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='780',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='780',meanbuyprice_withTax='780',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='780',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1854';
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', '1854', '1', '2026-10-12', '1', '0','0185401','810','810','810','780','','0','0','0','0','0','0','0','0','0','0'); -- id=1854
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1854', '1', '0', '1', '2026-10-12'); -- id=2871
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1854', '1', '0', '0', '1854', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4708
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1854, 1,'2026-10-12 13:16:09',1)
                ON DUPLICATE KEY UPDATE productid = 1854, edited = 1, sysdate = '2026-10-12 13:16:09', userid = 1; -- id=2776
UPDATE product SET productName = 'جاكيت 599 او ار', productDescription = '', productCatId = '143', productBuyPrice = '780.00', productSellAllPrice = '810.00', productSellUnitPrice = '810.00', productSellHalfPrice = '810.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01854',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '780',lastbuyprice_withDiscount = '780',meanbuyprice = '780',meanbuyprice_withDiscount = '780' , productbuypricereal = '780' , buypricereal_precentage = '0' , buytotal_precentage = '3.85' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='780',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='780',meanbuyprice_withTax='780',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='780',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1854';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:46:10";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:16:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:16:10', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7599
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:46:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:16:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:16:12', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7600
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:46:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:16:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:16:51', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7601

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accb33382906
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 13:16:51', '06accb33382906', '1', '0.00', '0', '0', '1', '2670.00', '2670', '2670', '0', '1', '2026-10-12 13:16:51', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2670','0','','0','0','2670','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=431
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','اضافة فاتورة مبيعات','431', '0', '2026-10-12 13:16:51', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2670', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 13:16:51','0','0','',''); -- id=563
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 788;
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 ('441','01805', '431', '122', '1805', '3', '490', '1470', '0', '', '0', '2026-10-12 13:16:51', '1805', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','788-3,','1','1','0','0','490','1470','0','','0','0.00','0','0','0','0'); -- id=1538
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 441.00, meanbuyprice_withDiscount = 441.00
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 441
                where sellbilldetailid = 1538;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1805, '2026-10-12', 1470, 1470, 1470
                    , 1470, 1323, 1323, 1323
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1470, 1470, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1470
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1323, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1323
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1323
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1470
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1470, 1470, 1470
                    , 1470, 1323, 1323, 1323
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1470, 1470, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1470
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1323, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1323
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1323
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1470
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '2', storedetaildate = '2026-10-12 13:16:51' WHERE storedetailid = '2819';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1805', '1', '3', '1', '431', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '21', '2', '2026-10-12 13:16:51','0','0'); -- id=4709
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 74;
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','01382', '431', '94', '1382', '3', '400', '1200', '0', '', '0', '2026-10-12 13:16:51', '1382', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','74-3,','1','1','0','0','400','1200','0','','0','0.00','0','0','0','0'); -- id=1539
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 = 1539;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1382, '2026-10-12', 1200, 1080, 1080
                    , 1080, 1080, 1080, 1080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1200, 1080, 1080
                    , 1080, 1080, 1080, 1080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 13:16:51' WHERE storedetailid = '1382';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1382', '1', '3', '1', '431', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '15', '2', '2026-10-12 13:16:51','0','0'); -- id=4710
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2504870',  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 ('2502200','2670', '0', '2', 'اضافة فاتورة مبيعات', '431', '2504870', '2026-10-12 13:16:52', '2',  'sellbillController.php','1','','0'); -- id=536
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2670', '2670', '2026-10-12', '2', '0', '0', '2026-10-12 13:16:52','اضافة فاتورة مبيعات رقم 431','1','0',null,'0','431','sellbillController.php?do=showDetail&sellbillid=431'); -- id=2107
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2107', '419', '2670', '','0'); -- id=2148
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2504870', 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 ('2107', '143', '2670', '','0'); -- id=2109
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4332170', 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 ( '2403', '2403', '2026-10-12', '2', '0', '0', '2026-10-12 13:16:52','اضافة فاتورة مبيعات رقم 431 - صرف البضاعة من المخزن','1','0',null,'0','431','sellbillController.php?do=showDetail&sellbillid=431'); -- id=2108
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2108', '402', '2403', '','0'); -- id=2149
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4046861.33', 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 ('2108', '382', '2403', '','0'); -- id=2110
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19702320.97', 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='2107,0,2108' where sellbillid=431;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2670, 2550, 2550
                    , 2550, 2403, 2403, 2403
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2550, 2550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2670, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2403, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2403
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2403
                            , 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;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2670, 2550, 2550
                    , 2550, 2403, 2403, 2403
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2550, 2550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2670, sellCostBuyPrice =sellCostBuyPrice+2550
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2550, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2550
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2403, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2403
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2403
                            , 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 2670, 2550, 2550
                    , 2550, 2403, 2403, 2403, 2550, 2550)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2670, netSellCostBuyPrice = netSellCostBuyPrice+2550
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2550
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2550
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2403
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2403
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2403
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2550
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2550;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accb33382906 and sellbillId = 431 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:46:52";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:16:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:16:52', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7602
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:47:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:17:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 13:17:03', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7603
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:47:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:17:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 13:17:12', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7604
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:47:19";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:17:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:17:19', '2', 'showDetail', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=431'); -- id=7605
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:47:30";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:17:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:17:30', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7606
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:47:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:17:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 13:17:49', '1', 'add2', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=7607
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 ('تي بي ان TBN','2026-10-12','','93', '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=144
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (144, 1,'2026-10-12 13:17:49',1)
                ON DUPLICATE KEY UPDATE catid = 144, edited = 1, sysdate = '2026-10-12 13:17:49', userid = 1; -- id=156
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '144', '1', '2026-10-12', '1', '0'); -- id=55
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:47:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:17:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 13:17:49', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=7608
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:47:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:17:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 13:17:51', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=7609
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:47:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:17:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:17:53', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7610
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:48:59";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:18:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:18:59', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=7611
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 ('اوفر تي بي ان 400','','144','400','400','400','400','2026-10-12','0','1','0','','0','0','0','0','0','400','400','400','400','400','0','0','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=1855
UPDATE product SET productName = 'اوفر تي بي ان 400', productDescription = '', productCatId = '144', productBuyPrice = '400', productSellAllPrice = '400', productSellUnitPrice = '400', productSellHalfPrice = '400', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01855',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 = '0' , 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 = '1855';
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', '1855', '1.00', '2026-10-12', '1', '0','0185501','400','400','400','400','','0','0','0','0','0','0','0','0','0','0'); -- id=1855
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1855', '1', '0', '1', '2026-10-12'); -- id=2872
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1855', '1', '0', '0', '1855', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4711
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1855, 1,'2026-10-12 13:18:59',1)
                ON DUPLICATE KEY UPDATE productid = 1855, edited = 1, sysdate = '2026-10-12 13:18:59', userid = 1; -- id=2777
UPDATE product SET productName = 'اوفر تي بي ان 400', productDescription = '', productCatId = '144', productBuyPrice = '400.00', productSellAllPrice = '400.00', productSellUnitPrice = '400.00', productSellHalfPrice = '400.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01855',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 = '0' , 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 = '1855';
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 ('اوفر تي بي ان 395','','144','395','395','395','395','2026-10-12','0','1','0','','0','0','0','0','0','395','395','395','395','395','0','0','0','0','.','0','0','0','395','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','395','395','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','395','0','0','0','0','0','0','','','0','0','0','0'); -- id=1856
UPDATE product SET productName = 'اوفر تي بي ان 395', productDescription = '', productCatId = '144', productBuyPrice = '395', productSellAllPrice = '395', productSellUnitPrice = '395', productSellHalfPrice = '395', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01856',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '395',lastbuyprice_withDiscount = '395',meanbuyprice = '395',meanbuyprice_withDiscount = '395' , productbuypricereal = '395' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='395',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='395',meanbuyprice_withTax='395',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='395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1856';
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', '1856', '1.00', '2026-10-12', '1', '0','0185601','395','395','395','395','','0','0','0','0','0','0','0','0','0','0'); -- id=1856
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1856', '1', '0', '1', '2026-10-12'); -- id=2873
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1856', '1', '0', '0', '1856', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4712
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1856, 1,'2026-10-12 13:18:59',1)
                ON DUPLICATE KEY UPDATE productid = 1856, edited = 1, sysdate = '2026-10-12 13:18:59', userid = 1; -- id=2778
UPDATE product SET productName = 'اوفر تي بي ان 395', productDescription = '', productCatId = '144', productBuyPrice = '395.00', productSellAllPrice = '395.00', productSellUnitPrice = '395.00', productSellHalfPrice = '395.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01856',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '395',lastbuyprice_withDiscount = '395',meanbuyprice = '395',meanbuyprice_withDiscount = '395' , productbuypricereal = '395' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='395',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='395',meanbuyprice_withTax='395',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='395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1856';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:49:01";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:19:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:19:01', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7612
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:49:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:19:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:19:02', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7613
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 ('تي بي ان TBN', '', '', '', '', '0', '1', '2026-10-12 13:19:16', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=154
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 ('154', '0', '', '0', 'إضافة مورد جديد', '154', '', '2026-10-12 13:19:16', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=381
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('تي بي ان TBN', 'تي بي ان TBN', 'تي بي ان TBN', 'تي بي ان TBN', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-10-12 13:19:16'); -- id=637
UPDATE supplier SET suppliername = 'تي بي ان TBN', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-12', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='637',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '154';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:49:54";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:19:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:19:54', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=7614
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 ('06accb36c81d9f', '2026-10-12 13:16:12', '1', '0.00', '232900', '20', '0', '232920.00',  '232900.00', '', '232900', '1', '2026-10-12 13:19:54', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=109
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 ('01842', '109', '143', '1842', '24', '740', '17760.00', '0', '', '2026-10-12 13:19:54', '1842','','','0','0','0','0','0',null,'740','17760','0','0','0','0','0','0','0','0','1'); -- id=683
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1842, 0, 0
                    , 739.94, 24, 0, 0, 1, '2026-10-12 13:19:54')
                ON DUPLICATE KEY UPDATE buyprice = 739.94,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:19:54' ; -- id=889
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1842', '740', '24', '0', 'buyBillController.php', '683', '', '0', '0'); -- id=533
UPDATE product SET  productBuyPrice = "740" WHERE productId = 1842 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 683 ;
UPDATE product SET productName = 'جاكيت 140 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01842',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '739.94',meanbuyprice = '740',meanbuyprice_withDiscount = '739.94' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='739.94',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1842';
UPDATE buybilldetail SET  lastbuyprice = 740 , meanbuyprice = 740, lastbuyprice_withDiscount = 739.94, meanbuyprice_withDiscount = 739.94
        , lastbuyprice_withTax = 740, meanbuyprice_withTax = 740, lastbuyprice_withDiscountAndTax = 739.94
                where buybilldetailid = 683;
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1842;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2859';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1842', '1', '24', '0', '109', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4713
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 ('01843', '109', '143', '1843', '24', '740', '17760.00', '0', '', '2026-10-12 13:19:54', '1843','','','0','0','0','0','0',null,'740','17760','0','0','0','0','0','0','0','0','1'); -- id=684
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1843, 0, 0
                    , 739.94, 24, 0, 0, 1, '2026-10-12 13:19:54')
                ON DUPLICATE KEY UPDATE buyprice = 739.94,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:19:54' ; -- id=890
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1843', '740', '24', '0', 'buyBillController.php', '684', '', '0', '0'); -- id=534
UPDATE product SET  productBuyPrice = "740" WHERE productId = 1843 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 684 ;
UPDATE product SET productName = 'جاكيت 362 او ار', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01843',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '739.94',meanbuyprice = '740',meanbuyprice_withDiscount = '739.94' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='739.94',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1843';
UPDATE buybilldetail SET  lastbuyprice = 740 , meanbuyprice = 740, lastbuyprice_withDiscount = 739.94, meanbuyprice_withDiscount = 739.94
        , lastbuyprice_withTax = 740, meanbuyprice_withTax = 740, lastbuyprice_withDiscountAndTax = 739.94
                where buybilldetailid = 684;
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1843;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2860';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1843', '1', '24', '0', '109', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4714
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 ('01844', '109', '143', '1844', '24', '770', '18480.00', '0', '', '2026-10-12 13:19:54', '1844','','','0','0','0','0','0',null,'770','18480','0','0','0','0','0','0','0','0','1'); -- id=685
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1844, 0, 0
                    , 769.93, 24, 0, 0, 1, '2026-10-12 13:19:54')
                ON DUPLICATE KEY UPDATE buyprice = 769.93,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:19:54' ; -- id=891
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1844', '770', '24', '0', 'buyBillController.php', '685', '', '0', '0'); -- id=535
UPDATE product SET  productBuyPrice = "770" WHERE productId = 1844 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 685 ;
UPDATE product SET productName = 'جاكيت 333 او ار', productDescription = '', productCatId = '143', productBuyPrice = '770.00', productSellAllPrice = '800.00', productSellUnitPrice = '800.00', productSellHalfPrice = '800.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01844',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '770',lastbuyprice_withDiscount = '769.93',meanbuyprice = '770',meanbuyprice_withDiscount = '769.93' , productbuypricereal = '770.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.90' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='770',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='770',meanbuyprice_withTax='770',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='769.93',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1844';
UPDATE buybilldetail SET  lastbuyprice = 770 , meanbuyprice = 770, lastbuyprice_withDiscount = 769.93, meanbuyprice_withDiscount = 769.93
        , lastbuyprice_withTax = 770, meanbuyprice_withTax = 770, lastbuyprice_withDiscountAndTax = 769.93
                where buybilldetailid = 685;
UPDATE productunit SET proUnitBuyPrice  = 770 * productnumber WHERE productid = 1844;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2861';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1844', '1', '24', '0', '109', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4715
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 ('01845', '109', '143', '1845', '24', '740', '17760.00', '0', '', '2026-10-12 13:19:54', '1845','','','0','0','0','0','0',null,'740','17760','0','0','0','0','0','0','0','0','1'); -- id=686
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1845, 0, 0
                    , 739.94, 24, 0, 0, 1, '2026-10-12 13:19:54')
                ON DUPLICATE KEY UPDATE buyprice = 739.94,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:19:54' ; -- id=892
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1845', '740', '24', '0', 'buyBillController.php', '686', '', '0', '0'); -- id=536
UPDATE product SET  productBuyPrice = "740" WHERE productId = 1845 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 686 ;
UPDATE product SET productName = 'جاكيت استرس او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01845',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '739.94',meanbuyprice = '740',meanbuyprice_withDiscount = '739.94' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='739.94',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1845';
UPDATE buybilldetail SET  lastbuyprice = 740 , meanbuyprice = 740, lastbuyprice_withDiscount = 739.94, meanbuyprice_withDiscount = 739.94
        , lastbuyprice_withTax = 740, meanbuyprice_withTax = 740, lastbuyprice_withDiscountAndTax = 739.94
                where buybilldetailid = 686;
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1845;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2862';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1845', '1', '24', '0', '109', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4716
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 ('01846', '109', '143', '1846', '28', '600', '16800.00', '0', '', '2026-10-12 13:19:54', '1846','','','0','0','0','0','0',null,'600','16800','0','0','0','0','0','0','0','0','1'); -- id=687
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1846, 0, 0
                    , 599.95, 28, 0, 0, 1, '2026-10-12 13:19:54')
                ON DUPLICATE KEY UPDATE buyprice = 599.95,
                        buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:19:54' ; -- id=893
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1846', '600', '28', '0', 'buyBillController.php', '687', '', '0', '0'); -- id=537
UPDATE product SET  productBuyPrice = "600" WHERE productId = 1846 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 687 ;
UPDATE product SET productName = 'جاكيت 14054 او ار', productDescription = '', productCatId = '143', productBuyPrice = '600.00', productSellAllPrice = '630.00', productSellUnitPrice = '630.00', productSellHalfPrice = '630.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01846',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '599.95',meanbuyprice = '600',meanbuyprice_withDiscount = '599.95' , productbuypricereal = '600.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='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='599.95',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1846';
UPDATE buybilldetail SET  lastbuyprice = 600 , meanbuyprice = 600, lastbuyprice_withDiscount = 599.95, meanbuyprice_withDiscount = 599.95
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 599.95
                where buybilldetailid = 687;
UPDATE productunit SET proUnitBuyPrice  = 600 * productnumber WHERE productid = 1846;
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2863';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1846', '1', '28', '0', '109', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '28', '1', '2026-10-12 13:16:12','0','0'); -- id=4717
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 ('01847', '109', '143', '1847', '24', '750', '18000.00', '0', '', '2026-10-12 13:19:54', '1847','','','0','0','0','0','0',null,'750','18000','0','0','0','0','0','0','0','0','1'); -- id=688
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1847, 0, 0
                    , 749.94, 24, 0, 0, 1, '2026-10-12 13:19:54')
                ON DUPLICATE KEY UPDATE buyprice = 749.94,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:19:54' ; -- id=894
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1847', '750', '24', '0', 'buyBillController.php', '688', '', '0', '0'); -- id=538
UPDATE product SET  productBuyPrice = "750" WHERE productId = 1847 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 688 ;
UPDATE product SET productName = 'جاكيت 103 او ار', productDescription = '', productCatId = '143', productBuyPrice = '750.00', productSellAllPrice = '780.00', productSellUnitPrice = '780.00', productSellHalfPrice = '780.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01847',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '750',lastbuyprice_withDiscount = '749.94',meanbuyprice = '750',meanbuyprice_withDiscount = '749.94' , productbuypricereal = '750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.00' , 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='749.94',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1847';
UPDATE buybilldetail SET  lastbuyprice = 750 , meanbuyprice = 750, lastbuyprice_withDiscount = 749.94, meanbuyprice_withDiscount = 749.94
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 750, lastbuyprice_withDiscountAndTax = 749.94
                where buybilldetailid = 688;
UPDATE productunit SET proUnitBuyPrice  = 750 * productnumber WHERE productid = 1847;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2864';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1847', '1', '24', '0', '109', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4718
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 ('01848', '109', '143', '1848', '28', '750', '21000.00', '0', '', '2026-10-12 13:19:54', '1848','','','0','0','0','0','0',null,'750','21000','0','0','0','0','0','0','0','0','1'); -- id=689
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1848, 0, 0
                    , 749.94, 28, 0, 0, 1, '2026-10-12 13:19:54')
                ON DUPLICATE KEY UPDATE buyprice = 749.94,
                        buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:19:54' ; -- id=895
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1848', '750', '28', '0', 'buyBillController.php', '689', '', '0', '0'); -- id=539
UPDATE product SET  productBuyPrice = "750" WHERE productId = 1848 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 689 ;
UPDATE product SET productName = 'جاكيت 365 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '750.00', productSellAllPrice = '780.00', productSellUnitPrice = '780.00', productSellHalfPrice = '780.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01848',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '750',lastbuyprice_withDiscount = '749.94',meanbuyprice = '750',meanbuyprice_withDiscount = '749.94' , productbuypricereal = '750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.00' , 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='749.94',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1848';
UPDATE buybilldetail SET  lastbuyprice = 750 , meanbuyprice = 750, lastbuyprice_withDiscount = 749.94, meanbuyprice_withDiscount = 749.94
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 750, lastbuyprice_withDiscountAndTax = 749.94
                where buybilldetailid = 689;
UPDATE productunit SET proUnitBuyPrice  = 750 * productnumber WHERE productid = 1848;
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2865';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1848', '1', '28', '0', '109', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '28', '1', '2026-10-12 13:16:12','0','0'); -- id=4719
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 ('01849', '109', '143', '1849', '24', '650', '15600.00', '0', '', '2026-10-12 13:19:54', '1849','','','0','0','0','0','0',null,'650','15600','0','0','0','0','0','0','0','0','1'); -- id=690
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1849, 0, 0
                    , 649.94, 24, 0, 0, 1, '2026-10-12 13:19:54')
                ON DUPLICATE KEY UPDATE buyprice = 649.94,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:19:54' ; -- id=896
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1849', '650', '24', '0', 'buyBillController.php', '690', '', '0', '0'); -- id=540
UPDATE product SET  productBuyPrice = "650" WHERE productId = 1849 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 690 ;
UPDATE product SET productName = 'جاكيت 2003 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '650.00', productSellAllPrice = '680.00', productSellUnitPrice = '680.00', productSellHalfPrice = '680.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01849',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '649.94',meanbuyprice = '650',meanbuyprice_withDiscount = '649.94' , productbuypricereal = '650.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.62' , 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='649.94',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1849';
UPDATE buybilldetail SET  lastbuyprice = 650 , meanbuyprice = 650, lastbuyprice_withDiscount = 649.94, meanbuyprice_withDiscount = 649.94
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 650, lastbuyprice_withDiscountAndTax = 649.94
                where buybilldetailid = 690;
UPDATE productunit SET proUnitBuyPrice  = 650 * productnumber WHERE productid = 1849;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2866';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1849', '1', '24', '0', '109', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4720
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 ('01850', '109', '143', '1850', '24', '740', '17760.00', '0', '', '2026-10-12 13:19:54', '1850','','','0','0','0','0','0',null,'740','17760','0','0','0','0','0','0','0','0','1'); -- id=691
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1850, 0, 0
                    , 739.94, 24, 0, 0, 1, '2026-10-12 13:19:54')
                ON DUPLICATE KEY UPDATE buyprice = 739.94,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:19:54' ; -- id=897
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1850', '740', '24', '0', 'buyBillController.php', '691', '', '0', '0'); -- id=541
UPDATE product SET  productBuyPrice = "740" WHERE productId = 1850 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 691 ;
UPDATE product SET productName = 'جاكيت 2001 او ار', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01850',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '739.94',meanbuyprice = '740',meanbuyprice_withDiscount = '739.94' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='739.94',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1850';
UPDATE buybilldetail SET  lastbuyprice = 740 , meanbuyprice = 740, lastbuyprice_withDiscount = 739.94, meanbuyprice_withDiscount = 739.94
        , lastbuyprice_withTax = 740, meanbuyprice_withTax = 740, lastbuyprice_withDiscountAndTax = 739.94
                where buybilldetailid = 691;
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1850;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2867';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1850', '1', '24', '0', '109', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4721
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 ('01851', '109', '143', '1851', '24', '740', '17760.00', '0', '', '2026-10-12 13:19:54', '1851','','','0','0','0','0','0',null,'740','17760','0','0','0','0','0','0','0','0','1'); -- id=692
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1851, 0, 0
                    , 739.94, 24, 0, 0, 1, '2026-10-12 13:19:54')
                ON DUPLICATE KEY UPDATE buyprice = 739.94,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:19:54' ; -- id=898
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1851', '740', '24', '0', 'buyBillController.php', '692', '', '0', '0'); -- id=542
UPDATE product SET  productBuyPrice = "740" WHERE productId = 1851 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 692 ;
UPDATE product SET productName = 'جاكيت 2002 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01851',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '739.94',meanbuyprice = '740',meanbuyprice_withDiscount = '739.94' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='740',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='740',meanbuyprice_withTax='740',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='739.94',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1851';
UPDATE buybilldetail SET  lastbuyprice = 740 , meanbuyprice = 740, lastbuyprice_withDiscount = 739.94, meanbuyprice_withDiscount = 739.94
        , lastbuyprice_withTax = 740, meanbuyprice_withTax = 740, lastbuyprice_withDiscountAndTax = 739.94
                where buybilldetailid = 692;
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1851;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2868';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1851', '1', '24', '0', '109', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4722
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 ('01852', '109', '143', '1852', '24', '750', '18000.00', '0', '', '2026-10-12 13:19:54', '1852','','','0','0','0','0','0',null,'750','18000','0','0','0','0','0','0','0','0','1'); -- id=693
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1852, 0, 0
                    , 749.94, 24, 0, 0, 1, '2026-10-12 13:19:54')
                ON DUPLICATE KEY UPDATE buyprice = 749.94,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:19:54' ; -- id=899
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1852', '750', '24', '0', 'buyBillController.php', '693', '', '0', '0'); -- id=543
UPDATE product SET  productBuyPrice = "750" WHERE productId = 1852 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 693 ;
UPDATE product SET productName = 'جاكيت 308 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '750.00', productSellAllPrice = '780.00', productSellUnitPrice = '780.00', productSellHalfPrice = '780.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01852',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '750',lastbuyprice_withDiscount = '749.94',meanbuyprice = '750',meanbuyprice_withDiscount = '749.94' , productbuypricereal = '750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.00' , 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='749.94',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1852';
UPDATE buybilldetail SET  lastbuyprice = 750 , meanbuyprice = 750, lastbuyprice_withDiscount = 749.94, meanbuyprice_withDiscount = 749.94
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 750, lastbuyprice_withDiscountAndTax = 749.94
                where buybilldetailid = 693;
UPDATE productunit SET proUnitBuyPrice  = 750 * productnumber WHERE productid = 1852;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2869';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1852', '1', '24', '0', '109', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4723
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 ('01853', '109', '143', '1853', '24', '730', '17520.00', '0', '', '2026-10-12 13:19:54', '1853','','','0','0','0','0','0',null,'730','17520','0','0','0','0','0','0','0','0','1'); -- id=694
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1853, 0, 0
                    , 729.94, 24, 0, 0, 1, '2026-10-12 13:19:54')
                ON DUPLICATE KEY UPDATE buyprice = 729.94,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:19:54' ; -- id=900
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1853', '730', '24', '0', 'buyBillController.php', '694', '', '0', '0'); -- id=544
UPDATE product SET  productBuyPrice = "730" WHERE productId = 1853 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 694 ;
UPDATE product SET productName = 'جاكيت 2013 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '730.00', productSellAllPrice = '760.00', productSellUnitPrice = '760.00', productSellHalfPrice = '760.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01853',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '730',lastbuyprice_withDiscount = '729.94',meanbuyprice = '730',meanbuyprice_withDiscount = '729.94' , productbuypricereal = '730.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='730',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='730',meanbuyprice_withTax='730',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='729.94',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1853';
UPDATE buybilldetail SET  lastbuyprice = 730 , meanbuyprice = 730, lastbuyprice_withDiscount = 729.94, meanbuyprice_withDiscount = 729.94
        , lastbuyprice_withTax = 730, meanbuyprice_withTax = 730, lastbuyprice_withDiscountAndTax = 729.94
                where buybilldetailid = 694;
UPDATE productunit SET proUnitBuyPrice  = 730 * productnumber WHERE productid = 1853;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2870';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1853', '1', '24', '0', '109', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4724
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 ('01854', '109', '143', '1854', '24', '780', '18720.00', '0', '', '2026-10-12 13:19:54', '1854','','','0','0','0','0','0',null,'780','18720','0','0','0','0','0','0','0','0','1'); -- id=695
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1854, 0, 0
                    , 779.93, 24, 0, 0, 1, '2026-10-12 13:19:54')
                ON DUPLICATE KEY UPDATE buyprice = 779.93,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:19:54' ; -- id=901
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1854', '780', '24', '0', 'buyBillController.php', '695', '', '0', '0'); -- id=545
UPDATE product SET  productBuyPrice = "780" WHERE productId = 1854 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 695 ;
UPDATE product SET productName = 'جاكيت 599 او ار', productDescription = '', productCatId = '143', productBuyPrice = '780.00', productSellAllPrice = '810.00', productSellUnitPrice = '810.00', productSellHalfPrice = '810.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01854',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '780',lastbuyprice_withDiscount = '779.93',meanbuyprice = '780',meanbuyprice_withDiscount = '779.93' , productbuypricereal = '780.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.85' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='780',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='780',meanbuyprice_withTax='780',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='779.93',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1854';
UPDATE buybilldetail SET  lastbuyprice = 780 , meanbuyprice = 780, lastbuyprice_withDiscount = 779.93, meanbuyprice_withDiscount = 779.93
        , lastbuyprice_withTax = 780, meanbuyprice_withTax = 780, lastbuyprice_withDiscountAndTax = 779.93
                where buybilldetailid = 695;
UPDATE productunit SET proUnitBuyPrice  = 780 * productnumber WHERE productid = 1854;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2871';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1854', '1', '24', '0', '109', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4725
UPDATE supplier SET  suppliercurrentDebt = '232900',suppliercurrentDebtInCurrency= '232900' , userid = '1', supplierdate = '2026-10-12 13:19:54'   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', '232900', '0', 'اضافة فاتورة مشتريات', '109', '232900', '2026-10-12 13:16:12', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','232900','1','0','232900','232900','0',''); -- id=382
update buybill set dailyentryid='0,0' where buybillid=109;
COMMIT;
UPDATE product SET overAllAveragePrice = 739.94 WHERE productId = 1842;UPDATE product SET overAllAveragePrice = 739.94 WHERE productId = 1843;UPDATE product SET overAllAveragePrice = 769.93 WHERE productId = 1844;UPDATE product SET overAllAveragePrice = 739.94 WHERE productId = 1845;UPDATE product SET overAllAveragePrice = 599.95 WHERE productId = 1846;UPDATE product SET overAllAveragePrice = 749.94 WHERE productId = 1847;UPDATE product SET overAllAveragePrice = 749.94 WHERE productId = 1848;UPDATE product SET overAllAveragePrice = 649.94 WHERE productId = 1849;UPDATE product SET overAllAveragePrice = 739.94 WHERE productId = 1850;UPDATE product SET overAllAveragePrice = 739.94 WHERE productId = 1851;UPDATE product SET overAllAveragePrice = 749.94 WHERE productId = 1852;UPDATE product SET overAllAveragePrice = 729.94 WHERE productId = 1853;UPDATE product SET overAllAveragePrice = 779.93 WHERE productId = 1854;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:49:54";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:19:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:19:54', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=109'); -- id=7615
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:50:10";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:20:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:20:10', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=7616
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 ('06accb416aef64', '2026-10-12 13:19:02', '154', '0.00', '142178.4', '7', '1', '152880.00',  '142178.40', '0', '142178.4', '1', '2026-10-12 13:20:10', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=110
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 ('01855', '110', '144', '1855', '240', '400', '96000.00', '0', '', '2026-10-12 13:20:10', '1855','','','0','0','0','0','0',null,'400','96000','0','0','0','0','0','0','0','0','1'); -- id=696
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:19:02', 1, 1855, 0, 0
                    , 372, 240, 0, 0, 1, '2026-10-12 13:20:10')
                ON DUPLICATE KEY UPDATE buyprice = 372,
                        buyQuantity =buyQuantity+240, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:20:10' ; -- id=902
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1855', '400', '240', '0', 'buyBillController.php', '696', '', '0', '0'); -- id=546
UPDATE product SET  productBuyPrice = "400" WHERE productId = 1855 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 696 ;
UPDATE product SET productName = 'اوفر تي بي ان 400', productDescription = '', productCatId = '144', productBuyPrice = '400.00', productSellAllPrice = '400.00', productSellUnitPrice = '400.00', productSellHalfPrice = '400.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01855',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '372',meanbuyprice = '400',meanbuyprice_withDiscount = '372' , productbuypricereal = '400.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='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='372',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1855';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 372, meanbuyprice_withDiscount = 372
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 372
                where buybilldetailid = 696;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 1855;
UPDATE storedetail SET  productquantity = '240', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2872';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1855', '1', '240', '0', '110', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '240', '1', '2026-10-12 13:19:02','0','0'); -- id=4726
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 ('01856', '110', '144', '1856', '144', '395', '56880.00', '0', '', '2026-10-12 13:20:10', '1856','','','0','0','0','0','0',null,'395','56880','0','0','0','0','0','0','0','0','1'); -- id=697
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:19:02', 1, 1856, 0, 0
                    , 367.35, 144, 0, 0, 1, '2026-10-12 13:20:10')
                ON DUPLICATE KEY UPDATE buyprice = 367.35,
                        buyQuantity =buyQuantity+144, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:20:10' ; -- id=903
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1856', '395', '144', '0', 'buyBillController.php', '697', '', '0', '0'); -- id=547
UPDATE product SET  productBuyPrice = "395" WHERE productId = 1856 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 697 ;
UPDATE product SET productName = 'اوفر تي بي ان 395', productDescription = '', productCatId = '144', productBuyPrice = '395.00', productSellAllPrice = '395.00', productSellUnitPrice = '395.00', productSellHalfPrice = '395.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01856',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '395',lastbuyprice_withDiscount = '367.35',meanbuyprice = '395',meanbuyprice_withDiscount = '367.35' , productbuypricereal = '395.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='395',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='395',meanbuyprice_withTax='395',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='367.35',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1856';
UPDATE buybilldetail SET  lastbuyprice = 395 , meanbuyprice = 395, lastbuyprice_withDiscount = 367.35, meanbuyprice_withDiscount = 367.35
        , lastbuyprice_withTax = 395, meanbuyprice_withTax = 395, lastbuyprice_withDiscountAndTax = 367.35
                where buybilldetailid = 697;
UPDATE productunit SET proUnitBuyPrice  = 395 * productnumber WHERE productid = 1856;
UPDATE storedetail SET  productquantity = '144', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2873';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1856', '1', '144', '0', '110', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '144', '1', '2026-10-12 13:19:02','0','0'); -- id=4727
UPDATE supplier SET  suppliercurrentDebt = '142178.4',suppliercurrentDebtInCurrency= '142178.4' , userid = '1', supplierdate = '2026-10-12 13:20:10'   WHERE supplierid = '154';
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 ('154', '0.00', '142178.4', '0', 'اضافة فاتورة مشتريات', '110', '142178.4', '2026-10-12 13:19:02', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','142178.4','1','0','142178.4','142178.4','0',''); -- id=383
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '142178.4', '142178.4', '2026-10-12', '1', '0', '0', '2026-10-12 13:20:10','اضافة فاتورة مشتريات رقم 110','1','0',null,'0','110','buyBillController.php?do=details&id=110'); -- id=2109
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2109', '382', '142178.4', '','0'); -- id=2150
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19844499.37', 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 ('2109', '637', '142178.4', '','0'); -- id=2111
UPDATE accountstree SET name = 'تي بي ان TBN', customName = 'تي بي ان TBN', customNameEn = 'تي بي ان TBN', nameEn = 'تي بي ان TBN', parent = '81', accountNature = '1', theValue = '142178.4', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 13:19:16' WHERE id = '637';
update buybill set dailyentryid='2109,0' where buybillid=110;
COMMIT;
UPDATE product SET overAllAveragePrice = 372 WHERE productId = 1855;UPDATE product SET overAllAveragePrice = 367.35 WHERE productId = 1856;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:50:10";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:20:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:20:10', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=110'); -- id=7617
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:50:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:20:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:20:33', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=110&type=2'); -- id=7618
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:52:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:22:33", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 13:22:33', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7619
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:53:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:23:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:23:42', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7620
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:54:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:24:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:24:00', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7621
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:54:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:24:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:24:12', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7622
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:55:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:25:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:25:18', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7623
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:55:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:25:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:25:20', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7624
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:55:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:25:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:25:22', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7625
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:55:32";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:25:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:25:32', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7626
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:55:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:25:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:25:33', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7627
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:55:57";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:25:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:25:57', '1', 'details', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=26'); -- id=7628
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:56:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:26:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:26:07', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7629
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:56:09";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:26:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:26:09', '1', 'details', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=89'); -- id=7630
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 09:59:56";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:29:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-12 13:29:56', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=7631
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:00:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:30:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:30:07', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7632
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:04:43";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:34:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:34:43', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7633

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accb3bb0352e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 13:34:43', '06accb3bb0352e', '1', '0.00', '0', '20', '1', '3120.00', '3100', '3100', '0', '1', '2026-10-12 13:34:43', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '8' ,'0','','','','','-1','0','0','0','0','0','3100','0','','0','0','3100','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=432
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','اضافة فاتورة مبيعات','432', '0', '2026-10-12 13:34:43', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3100', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 13:34:43','0','0','',''); -- id=564
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 61;
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','09496', '432', '33', '1045', '5', '270', '1350', '0', '', '0', '2026-10-12 13:34:43', '1045', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','61-5,','1','1','0','0','270','1350','0','','0','0.00','0','0','0','0'); -- id=1540
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 = 1540;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1045, '2026-10-12', 1341.3461538462, 1250, 1250
                    , 1250, 1250, 1250, 1250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1250, 1250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1341.3461538462, sellCostBuyPrice =sellCostBuyPrice+1250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1341.3461538462, 1250, 1250
                    , 1250, 1250, 1250, 1250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1250, 1250, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1341.3461538462, sellCostBuyPrice =sellCostBuyPrice+1250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1250
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '100', userid = '2', storedetaildate = '2026-10-12 13:34:43' WHERE storedetailid = '1045';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1045', '1', '5', '1', '432', 'اضافة فاتورة مبيعات', 'sellbillController.php', '105', '100', '2', '2026-10-12 13:34:43','0','0'); -- id=4728
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 520;
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 ('542.8','01671', '432', '124', '1671', '3', '590', '1770', '0', '', '0', '2026-10-12 13:34:43', '1671', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','520-3,','1','1','0','0','590','1770','0','','0','0.00','0','0','0','0'); -- id=1541
UPDATE sellbilldetail SET  lastbuyprice = 590.00 , meanbuyprice = 590.00, lastbuyprice_withDiscount = 542.80, meanbuyprice_withDiscount = 542.80
        , lastbuyprice_withTax = 590, meanbuyprice_withTax = 590, lastbuyprice_withDiscountAndTax = 542.8
                where sellbilldetailid = 1541;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1671, '2026-10-12', 1758.6538461538, 1770, 1770
                    , 1770, 1628.4, 1628.4, 1628.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1758.6538461538, sellCostBuyPrice =sellCostBuyPrice+1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1628.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1628.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1628.4
                            , 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+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-10-12', 1758.6538461538, 1770, 1770
                    , 1770, 1628.4, 1628.4, 1628.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1758.6538461538, sellCostBuyPrice =sellCostBuyPrice+1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1628.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1628.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1628.4
                            , 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 = '21', userid = '2', storedetaildate = '2026-10-12 13:34:43' WHERE storedetailid = '2683';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1671', '1', '3', '1', '432', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '21', '2', '2026-10-12 13:34:43','0','0'); -- id=4729
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2507970',  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 ('2504870','3100', '0', '2', 'اضافة فاتورة مبيعات', '432', '2507970', '2026-10-12 13:34:43', '2',  'sellbillController.php','1','','0'); -- id=537
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3120', '3120', '2026-10-12', '2', '0', '0', '2026-10-12 13:34:43','اضافة فاتورة مبيعات رقم 432','1','0',null,'0','432','sellbillController.php?do=showDetail&sellbillid=432'); -- id=2110
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2110', '419', '3100', '','0'); -- id=2151
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2507970', 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 ('2110', '398', '20', '','0'); -- id=2152
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '464665', theOrder = '0', layingOrder = '51', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-08-08 17:58:26' WHERE id = '398';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2110', '143', '3120', '','0'); -- id=2112
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4335290', 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 ( '2878.4', '2878.4', '2026-10-12', '2', '0', '0', '2026-10-12 13:34:43','اضافة فاتورة مبيعات رقم 432 - صرف البضاعة من المخزن','1','0',null,'0','432','sellbillController.php?do=showDetail&sellbillid=432'); -- id=2111
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2111', '402', '2878.4', '','0'); -- id=2153
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4049739.73', 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 ('2111', '382', '2878.4', '','0'); -- id=2113
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '19841620.97', 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='2110,0,2111' where sellbillid=432;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 3100, 3020, 3020
                    , 3020, 2878.4, 2878.4, 2878.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3020, 3020, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3020
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3020, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3020
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2878.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2878.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2878.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3020
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3020
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 3100, 3020, 3020
                    , 3020, 2878.4, 2878.4, 2878.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3020, 3020, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3020
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3020, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3020
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2878.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2878.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2878.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3020
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3020
                        , returnSellVal = returnSellVal+0, 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, 3100, 3020, 3020
                    , 3020, 2878.4, 2878.4, 2878.4, 3020, 3020)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3100, netSellCostBuyPrice = netSellCostBuyPrice+3020
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3020
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3020
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2878.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2878.4
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2878.4
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3020
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3020;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accb3bb0352e and sellbillId = 432 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:04:44";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:34:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:34:44', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7634
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:05:27";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:35:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:35:27', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7635
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:05:29";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:35:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:35:29', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7636
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:05:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:35:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:35:31', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=7637
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:05:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:35:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:35:31', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7638
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:05:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:35:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:35:41', '1', 'editbill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=109'); -- id=7639
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:06:37";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:36:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:36:37', '1', 'update', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=7640
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 109;
UPDATE buybill SET  buybillsysdate = '2026-10-12 13:36:37', userid = '1',delbyuserid = '1', conditions = '1' WHERE buybillid = '109';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1842, 0, 0
                    , 740, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=889
UPDATE buybilldetail SET  lastbuyprice = 740.00 , meanbuyprice = 740.00, lastbuyprice_withDiscount = 739.94, meanbuyprice_withDiscount = 739.94
        , lastbuyprice_withTax = 740.00, meanbuyprice_withTax = 740.00, lastbuyprice_withDiscountAndTax = 739.94
                where buybilldetailid = 683;
UPDATE product SET productName = 'جاكيت 140 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01842',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '0',meanbuyprice = '740.00',meanbuyprice_withDiscount = '740' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='739.94',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='740',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 = '1842';
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1842;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2859';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1842', '1', '24', '1', '109', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 13:16:12','0','0'); -- id=4730
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1843, 0, 0
                    , 740, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=890
UPDATE buybilldetail SET  lastbuyprice = 740.00 , meanbuyprice = 740.00, lastbuyprice_withDiscount = 739.94, meanbuyprice_withDiscount = 739.94
        , lastbuyprice_withTax = 740.00, meanbuyprice_withTax = 740.00, lastbuyprice_withDiscountAndTax = 739.94
                where buybilldetailid = 684;
UPDATE product SET productName = 'جاكيت 362 او ار', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01843',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '0',meanbuyprice = '740.00',meanbuyprice_withDiscount = '740' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='739.94',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='740',meanbuyprice_withTax='0',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='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 = '1843';
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1843;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2860';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1843', '1', '24', '1', '109', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 13:16:12','0','0'); -- id=4731
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1844, 0, 0
                    , 770, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=891
UPDATE buybilldetail SET  lastbuyprice = 770.00 , meanbuyprice = 770.00, lastbuyprice_withDiscount = 769.93, meanbuyprice_withDiscount = 769.93
        , lastbuyprice_withTax = 770.00, meanbuyprice_withTax = 770.00, lastbuyprice_withDiscountAndTax = 769.93
                where buybilldetailid = 685;
UPDATE product SET productName = 'جاكيت 333 او ار', productDescription = '', productCatId = '143', productBuyPrice = '770.00', productSellAllPrice = '800.00', productSellUnitPrice = '800.00', productSellHalfPrice = '800.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01844',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '770',lastbuyprice_withDiscount = '0',meanbuyprice = '770.00',meanbuyprice_withDiscount = '770' , productbuypricereal = '770.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.90' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='769.93',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='770',meanbuyprice_withTax='0',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='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 = '1844';
UPDATE productunit SET proUnitBuyPrice  = 770 * productnumber WHERE productid = 1844;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2861';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1844', '1', '24', '1', '109', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 13:16:12','0','0'); -- id=4732
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1845, 0, 0
                    , 740, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=892
UPDATE buybilldetail SET  lastbuyprice = 740.00 , meanbuyprice = 740.00, lastbuyprice_withDiscount = 739.94, meanbuyprice_withDiscount = 739.94
        , lastbuyprice_withTax = 740.00, meanbuyprice_withTax = 740.00, lastbuyprice_withDiscountAndTax = 739.94
                where buybilldetailid = 686;
UPDATE product SET productName = 'جاكيت استرس او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01845',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '0',meanbuyprice = '740.00',meanbuyprice_withDiscount = '740' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='739.94',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='740',meanbuyprice_withTax='0',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='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 = '1845';
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1845;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2862';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1845', '1', '24', '1', '109', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 13:16:12','0','0'); -- id=4733
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1846, 0, 0
                    , 600, 28, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-28, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=893
UPDATE buybilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 599.95, meanbuyprice_withDiscount = 599.95
        , lastbuyprice_withTax = 600.00, meanbuyprice_withTax = 600.00, lastbuyprice_withDiscountAndTax = 599.95
                where buybilldetailid = 687;
UPDATE product SET productName = 'جاكيت 14054 او ار', productDescription = '', productCatId = '143', productBuyPrice = '600.00', productSellAllPrice = '630.00', productSellUnitPrice = '630.00', productSellHalfPrice = '630.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01846',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '600',lastbuyprice_withDiscount = '0',meanbuyprice = '600.00',meanbuyprice_withDiscount = '600' , productbuypricereal = '600.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='599.95',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='0',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='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 = '1846';
UPDATE productunit SET proUnitBuyPrice  = 600 * productnumber WHERE productid = 1846;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2863';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1846', '1', '28', '1', '109', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '28', '0', '1', '2026-10-12 13:16:12','0','0'); -- id=4734
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1847, 0, 0
                    , 750, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=894
UPDATE buybilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 749.94, meanbuyprice_withDiscount = 749.94
        , lastbuyprice_withTax = 750.00, meanbuyprice_withTax = 750.00, lastbuyprice_withDiscountAndTax = 749.94
                where buybilldetailid = 688;
UPDATE product SET productName = 'جاكيت 103 او ار', productDescription = '', productCatId = '143', productBuyPrice = '750.00', productSellAllPrice = '780.00', productSellUnitPrice = '780.00', productSellHalfPrice = '780.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01847',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '750',lastbuyprice_withDiscount = '0',meanbuyprice = '750.00',meanbuyprice_withDiscount = '750' , productbuypricereal = '750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='749.94',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='0',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='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 = '1847';
UPDATE productunit SET proUnitBuyPrice  = 750 * productnumber WHERE productid = 1847;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2864';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1847', '1', '24', '1', '109', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 13:16:12','0','0'); -- id=4735
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1848, 0, 0
                    , 750, 28, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-28, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=895
UPDATE buybilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 749.94, meanbuyprice_withDiscount = 749.94
        , lastbuyprice_withTax = 750.00, meanbuyprice_withTax = 750.00, lastbuyprice_withDiscountAndTax = 749.94
                where buybilldetailid = 689;
UPDATE product SET productName = 'جاكيت 365 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '750.00', productSellAllPrice = '780.00', productSellUnitPrice = '780.00', productSellHalfPrice = '780.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01848',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '750',lastbuyprice_withDiscount = '0',meanbuyprice = '750.00',meanbuyprice_withDiscount = '750' , productbuypricereal = '750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='749.94',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='0',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='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 = '1848';
UPDATE productunit SET proUnitBuyPrice  = 750 * productnumber WHERE productid = 1848;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2865';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1848', '1', '28', '1', '109', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '28', '0', '1', '2026-10-12 13:16:12','0','0'); -- id=4736
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1849, 0, 0
                    , 650, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=896
UPDATE buybilldetail SET  lastbuyprice = 650.00 , meanbuyprice = 650.00, lastbuyprice_withDiscount = 649.94, meanbuyprice_withDiscount = 649.94
        , lastbuyprice_withTax = 650.00, meanbuyprice_withTax = 650.00, lastbuyprice_withDiscountAndTax = 649.94
                where buybilldetailid = 690;
UPDATE product SET productName = 'جاكيت 2003 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '650.00', productSellAllPrice = '680.00', productSellUnitPrice = '680.00', productSellHalfPrice = '680.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01849',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '0',meanbuyprice = '650.00',meanbuyprice_withDiscount = '650' , productbuypricereal = '650.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.62' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='649.94',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='0',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='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 = '1849';
UPDATE productunit SET proUnitBuyPrice  = 650 * productnumber WHERE productid = 1849;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2866';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1849', '1', '24', '1', '109', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 13:16:12','0','0'); -- id=4737
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1850, 0, 0
                    , 740, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=897
UPDATE buybilldetail SET  lastbuyprice = 740.00 , meanbuyprice = 740.00, lastbuyprice_withDiscount = 739.94, meanbuyprice_withDiscount = 739.94
        , lastbuyprice_withTax = 740.00, meanbuyprice_withTax = 740.00, lastbuyprice_withDiscountAndTax = 739.94
                where buybilldetailid = 691;
UPDATE product SET productName = 'جاكيت 2001 او ار', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01850',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '0',meanbuyprice = '740.00',meanbuyprice_withDiscount = '740' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='739.94',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='740',meanbuyprice_withTax='0',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='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 = '1850';
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1850;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2867';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1850', '1', '24', '1', '109', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 13:16:12','0','0'); -- id=4738
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1851, 0, 0
                    , 740, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=898
UPDATE buybilldetail SET  lastbuyprice = 740.00 , meanbuyprice = 740.00, lastbuyprice_withDiscount = 739.94, meanbuyprice_withDiscount = 739.94
        , lastbuyprice_withTax = 740.00, meanbuyprice_withTax = 740.00, lastbuyprice_withDiscountAndTax = 739.94
                where buybilldetailid = 692;
UPDATE product SET productName = 'جاكيت 2002 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01851',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '0',meanbuyprice = '740.00',meanbuyprice_withDiscount = '740' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='739.94',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='740',meanbuyprice_withTax='0',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='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 = '1851';
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1851;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2868';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1851', '1', '24', '1', '109', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 13:16:12','0','0'); -- id=4739
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1852, 0, 0
                    , 750, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=899
UPDATE buybilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 749.94, meanbuyprice_withDiscount = 749.94
        , lastbuyprice_withTax = 750.00, meanbuyprice_withTax = 750.00, lastbuyprice_withDiscountAndTax = 749.94
                where buybilldetailid = 693;
UPDATE product SET productName = 'جاكيت 308 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '750.00', productSellAllPrice = '780.00', productSellUnitPrice = '780.00', productSellHalfPrice = '780.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01852',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '750',lastbuyprice_withDiscount = '0',meanbuyprice = '750.00',meanbuyprice_withDiscount = '750' , productbuypricereal = '750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='749.94',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='0',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='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 = '1852';
UPDATE productunit SET proUnitBuyPrice  = 750 * productnumber WHERE productid = 1852;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2869';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1852', '1', '24', '1', '109', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 13:16:12','0','0'); -- id=4740
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1853, 0, 0
                    , 730, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=900
UPDATE buybilldetail SET  lastbuyprice = 730.00 , meanbuyprice = 730.00, lastbuyprice_withDiscount = 729.94, meanbuyprice_withDiscount = 729.94
        , lastbuyprice_withTax = 730.00, meanbuyprice_withTax = 730.00, lastbuyprice_withDiscountAndTax = 729.94
                where buybilldetailid = 694;
UPDATE product SET productName = 'جاكيت 2013 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '730.00', productSellAllPrice = '760.00', productSellUnitPrice = '760.00', productSellHalfPrice = '760.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01853',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '730',lastbuyprice_withDiscount = '0',meanbuyprice = '730.00',meanbuyprice_withDiscount = '730' , productbuypricereal = '730.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='729.94',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='730',meanbuyprice_withTax='0',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='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 = '1853';
UPDATE productunit SET proUnitBuyPrice  = 730 * productnumber WHERE productid = 1853;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2870';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1853', '1', '24', '1', '109', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 13:16:12','0','0'); -- id=4741
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1854, 0, 0
                    , 780, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=901
UPDATE buybilldetail SET  lastbuyprice = 780.00 , meanbuyprice = 780.00, lastbuyprice_withDiscount = 779.93, meanbuyprice_withDiscount = 779.93
        , lastbuyprice_withTax = 780.00, meanbuyprice_withTax = 780.00, lastbuyprice_withDiscountAndTax = 779.93
                where buybilldetailid = 695;
UPDATE product SET productName = 'جاكيت 599 او ار', productDescription = '', productCatId = '143', productBuyPrice = '780.00', productSellAllPrice = '810.00', productSellUnitPrice = '810.00', productSellHalfPrice = '810.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01854',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '780',lastbuyprice_withDiscount = '0',meanbuyprice = '780.00',meanbuyprice_withDiscount = '780' , productbuypricereal = '780.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.85' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='779.93',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='780',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 = '1854';
UPDATE productunit SET proUnitBuyPrice  = 780 * productnumber WHERE productid = 1854;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2871';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1854', '1', '24', '1', '109', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-12 13:16:12','0','0'); -- id=4742
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '0' , userid = '1', supplierdate = '2026-10-12 13:36:37'   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', '232900.00', '232900.00', '1', 'حذف فاتورة مشتريات - للتعديل', '109', '0', '2026-10-12 13:16:12', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','232900','1','232900','232900','0','0',''); -- id=384
UPDATE productserial SET del = 1
		 WHERE billid = 109;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06accb36c81d9f', '2026-10-12 13:16:12', '147', '-100000.00', '132920', '0', '0', '232920.00', '232920.00', '0.00', '232920', '1', '2026-10-12 13:36:37', '', '1', '0', '', '1', '1','1','109','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=111
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 ('01842', '111', '143', '1842', '24.00', '740', '17760.00', '0.00', '', '2026-10-12 13:36:37', '1842','','','0','0','0','0','0',null,'740','17760','0','0','0','0','0','0','0','0','1'); -- id=698
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1842, 0, 0
                    , 740, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyprice = 740,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=889
UPDATE product SET  productBuyPrice = "740" WHERE productId = 1842 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 698 ;
UPDATE product SET productName = 'جاكيت 140 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01842',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='739.94',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='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1842';
UPDATE buybilldetail SET  lastbuyprice = 740 , meanbuyprice = 740, lastbuyprice_withDiscount = 740, meanbuyprice_withDiscount = 740
        , lastbuyprice_withTax = 740, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 740
                where buybilldetailid = 698;
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1842;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2859';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1842', '1', '24', '0', '111', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4743
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 ('01843', '111', '143', '1843', '24.00', '740', '17760.00', '0.00', '', '2026-10-12 13:36:37', '1843','','','0','0','0','0','0',null,'740','17760','0','0','0','0','0','0','0','0','1'); -- id=699
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1843, 0, 0
                    , 740, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyprice = 740,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=890
UPDATE product SET  productBuyPrice = "740" WHERE productId = 1843 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 699 ;
UPDATE product SET productName = 'جاكيت 362 او ار', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01843',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='739.94',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='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1843';
UPDATE buybilldetail SET  lastbuyprice = 740 , meanbuyprice = 740, lastbuyprice_withDiscount = 740, meanbuyprice_withDiscount = 740
        , lastbuyprice_withTax = 740, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 740
                where buybilldetailid = 699;
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1843;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2860';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1843', '1', '24', '0', '111', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4744
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 ('01844', '111', '143', '1844', '24.00', '770', '18480.00', '0.00', '', '2026-10-12 13:36:37', '1844','','','0','0','0','0','0',null,'770','18480','0','0','0','0','0','0','0','0','1'); -- id=700
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1844, 0, 0
                    , 770, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyprice = 770,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=891
UPDATE product SET  productBuyPrice = "770" WHERE productId = 1844 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 700 ;
UPDATE product SET productName = 'جاكيت 333 او ار', productDescription = '', productCatId = '143', productBuyPrice = '770.00', productSellAllPrice = '800.00', productSellUnitPrice = '800.00', productSellHalfPrice = '800.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01844',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '770',lastbuyprice_withDiscount = '770',meanbuyprice = '770',meanbuyprice_withDiscount = '770' , productbuypricereal = '770.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.90' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='769.93',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='770',meanbuyprice_withTax='385',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='770',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1844';
UPDATE buybilldetail SET  lastbuyprice = 770 , meanbuyprice = 770, lastbuyprice_withDiscount = 770, meanbuyprice_withDiscount = 770
        , lastbuyprice_withTax = 770, meanbuyprice_withTax = 385, lastbuyprice_withDiscountAndTax = 770
                where buybilldetailid = 700;
UPDATE productunit SET proUnitBuyPrice  = 770 * productnumber WHERE productid = 1844;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2861';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1844', '1', '24', '0', '111', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4745
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 ('01845', '111', '143', '1845', '24.00', '740', '17760.00', '0.00', '', '2026-10-12 13:36:37', '1845','','','0','0','0','0','0',null,'740','17760','0','0','0','0','0','0','0','0','1'); -- id=701
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1845, 0, 0
                    , 740, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyprice = 740,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=892
UPDATE product SET  productBuyPrice = "740" WHERE productId = 1845 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 701 ;
UPDATE product SET productName = 'جاكيت استرس او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01845',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='739.94',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='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1845';
UPDATE buybilldetail SET  lastbuyprice = 740 , meanbuyprice = 740, lastbuyprice_withDiscount = 740, meanbuyprice_withDiscount = 740
        , lastbuyprice_withTax = 740, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 740
                where buybilldetailid = 701;
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1845;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2862';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1845', '1', '24', '0', '111', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4746
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 ('01846', '111', '143', '1846', '28.00', '600', '16800.00', '0.00', '', '2026-10-12 13:36:37', '1846','','','0','0','0','0','0',null,'600','16800','0','0','0','0','0','0','0','0','1'); -- id=702
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1846, 0, 0
                    , 600, 28, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyprice = 600,
                        buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=893
UPDATE product SET  productBuyPrice = "600" WHERE productId = 1846 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 702 ;
UPDATE product SET productName = 'جاكيت 14054 او ار', productDescription = '', productCatId = '143', productBuyPrice = '600.00', productSellAllPrice = '630.00', productSellUnitPrice = '630.00', productSellHalfPrice = '630.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01846',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 = '5.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='599.95',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='300',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 = '1846';
UPDATE buybilldetail SET  lastbuyprice = 600 , meanbuyprice = 600, lastbuyprice_withDiscount = 600, meanbuyprice_withDiscount = 600
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 600
                where buybilldetailid = 702;
UPDATE productunit SET proUnitBuyPrice  = 600 * productnumber WHERE productid = 1846;
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2863';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1846', '1', '28', '0', '111', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '28', '1', '2026-10-12 13:16:12','0','0'); -- id=4747
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 ('01847', '111', '143', '1847', '24.00', '750', '18000.00', '0.00', '', '2026-10-12 13:36:37', '1847','','','0','0','0','0','0',null,'750','18000','0','0','0','0','0','0','0','0','1'); -- id=703
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1847, 0, 0
                    , 750, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyprice = 750,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=894
UPDATE product SET  productBuyPrice = "750" WHERE productId = 1847 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 703 ;
UPDATE product SET productName = 'جاكيت 103 او ار', productDescription = '', productCatId = '143', productBuyPrice = '750.00', productSellAllPrice = '780.00', productSellUnitPrice = '780.00', productSellHalfPrice = '780.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01847',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 = '4.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='749.94',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='375',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 = '1847';
UPDATE buybilldetail SET  lastbuyprice = 750 , meanbuyprice = 750, lastbuyprice_withDiscount = 750, meanbuyprice_withDiscount = 750
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 375, lastbuyprice_withDiscountAndTax = 750
                where buybilldetailid = 703;
UPDATE productunit SET proUnitBuyPrice  = 750 * productnumber WHERE productid = 1847;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2864';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1847', '1', '24', '0', '111', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4748
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 ('01848', '111', '143', '1848', '28.00', '750', '21000.00', '0.00', '', '2026-10-12 13:36:37', '1848','','','0','0','0','0','0',null,'750','21000','0','0','0','0','0','0','0','0','1'); -- id=704
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1848, 0, 0
                    , 750, 28, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyprice = 750,
                        buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=895
UPDATE product SET  productBuyPrice = "750" WHERE productId = 1848 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 704 ;
UPDATE product SET productName = 'جاكيت 365 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '750.00', productSellAllPrice = '780.00', productSellUnitPrice = '780.00', productSellHalfPrice = '780.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01848',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 = '4.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='749.94',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='375',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 = '1848';
UPDATE buybilldetail SET  lastbuyprice = 750 , meanbuyprice = 750, lastbuyprice_withDiscount = 750, meanbuyprice_withDiscount = 750
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 375, lastbuyprice_withDiscountAndTax = 750
                where buybilldetailid = 704;
UPDATE productunit SET proUnitBuyPrice  = 750 * productnumber WHERE productid = 1848;
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2865';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1848', '1', '28', '0', '111', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '28', '1', '2026-10-12 13:16:12','0','0'); -- id=4749
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 ('01849', '111', '143', '1849', '24.00', '650', '15600.00', '0.00', '', '2026-10-12 13:36:37', '1849','','','0','0','0','0','0',null,'650','15600','0','0','0','0','0','0','0','0','1'); -- id=705
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1849, 0, 0
                    , 650, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyprice = 650,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=896
UPDATE product SET  productBuyPrice = "650" WHERE productId = 1849 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 705 ;
UPDATE product SET productName = 'جاكيت 2003 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '650.00', productSellAllPrice = '680.00', productSellUnitPrice = '680.00', productSellHalfPrice = '680.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01849',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '650',lastbuyprice_withDiscount = '650',meanbuyprice = '650',meanbuyprice_withDiscount = '650' , productbuypricereal = '650.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.62' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='649.94',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='325',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 = '1849';
UPDATE buybilldetail SET  lastbuyprice = 650 , meanbuyprice = 650, lastbuyprice_withDiscount = 650, meanbuyprice_withDiscount = 650
        , lastbuyprice_withTax = 650, meanbuyprice_withTax = 325, lastbuyprice_withDiscountAndTax = 650
                where buybilldetailid = 705;
UPDATE productunit SET proUnitBuyPrice  = 650 * productnumber WHERE productid = 1849;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2866';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1849', '1', '24', '0', '111', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4750
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 ('01850', '111', '143', '1850', '24.00', '740', '17760.00', '0.00', '', '2026-10-12 13:36:37', '1850','','','0','0','0','0','0',null,'740','17760','0','0','0','0','0','0','0','0','1'); -- id=706
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1850, 0, 0
                    , 740, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyprice = 740,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=897
UPDATE product SET  productBuyPrice = "740" WHERE productId = 1850 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 706 ;
UPDATE product SET productName = 'جاكيت 2001 او ار', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01850',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='739.94',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='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1850';
UPDATE buybilldetail SET  lastbuyprice = 740 , meanbuyprice = 740, lastbuyprice_withDiscount = 740, meanbuyprice_withDiscount = 740
        , lastbuyprice_withTax = 740, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 740
                where buybilldetailid = 706;
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1850;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2867';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1850', '1', '24', '0', '111', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4751
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 ('01851', '111', '143', '1851', '24.00', '740', '17760.00', '0.00', '', '2026-10-12 13:36:37', '1851','','','0','0','0','0','0',null,'740','17760','0','0','0','0','0','0','0','0','1'); -- id=707
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1851, 0, 0
                    , 740, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyprice = 740,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=898
UPDATE product SET  productBuyPrice = "740" WHERE productId = 1851 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 707 ;
UPDATE product SET productName = 'جاكيت 2002 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '740.00', productSellAllPrice = '770.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01851',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '740',lastbuyprice_withDiscount = '740',meanbuyprice = '740',meanbuyprice_withDiscount = '740' , productbuypricereal = '740.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.05' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='739.94',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='740',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='740',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1851';
UPDATE buybilldetail SET  lastbuyprice = 740 , meanbuyprice = 740, lastbuyprice_withDiscount = 740, meanbuyprice_withDiscount = 740
        , lastbuyprice_withTax = 740, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 740
                where buybilldetailid = 707;
UPDATE productunit SET proUnitBuyPrice  = 740 * productnumber WHERE productid = 1851;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2868';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1851', '1', '24', '0', '111', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4752
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 ('01852', '111', '143', '1852', '24.00', '750', '18000.00', '0.00', '', '2026-10-12 13:36:37', '1852','','','0','0','0','0','0',null,'750','18000','0','0','0','0','0','0','0','0','1'); -- id=708
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1852, 0, 0
                    , 750, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyprice = 750,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=899
UPDATE product SET  productBuyPrice = "750" WHERE productId = 1852 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 708 ;
UPDATE product SET productName = 'جاكيت 308 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '750.00', productSellAllPrice = '780.00', productSellUnitPrice = '780.00', productSellHalfPrice = '780.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01852',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 = '4.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='749.94',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='375',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 = '1852';
UPDATE buybilldetail SET  lastbuyprice = 750 , meanbuyprice = 750, lastbuyprice_withDiscount = 750, meanbuyprice_withDiscount = 750
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 375, lastbuyprice_withDiscountAndTax = 750
                where buybilldetailid = 708;
UPDATE productunit SET proUnitBuyPrice  = 750 * productnumber WHERE productid = 1852;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2869';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1852', '1', '24', '0', '111', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4753
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 ('01853', '111', '143', '1853', '24.00', '730', '17520.00', '0.00', '', '2026-10-12 13:36:37', '1853','','','0','0','0','0','0',null,'730','17520','0','0','0','0','0','0','0','0','1'); -- id=709
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1853, 0, 0
                    , 730, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyprice = 730,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=900
UPDATE product SET  productBuyPrice = "730" WHERE productId = 1853 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 709 ;
UPDATE product SET productName = 'جاكيت 2013 او ار ', productDescription = '', productCatId = '143', productBuyPrice = '730.00', productSellAllPrice = '760.00', productSellUnitPrice = '760.00', productSellHalfPrice = '760.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01853',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '730',lastbuyprice_withDiscount = '730',meanbuyprice = '730',meanbuyprice_withDiscount = '730' , productbuypricereal = '730.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='729.94',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='730',meanbuyprice_withTax='365',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='730',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1853';
UPDATE buybilldetail SET  lastbuyprice = 730 , meanbuyprice = 730, lastbuyprice_withDiscount = 730, meanbuyprice_withDiscount = 730
        , lastbuyprice_withTax = 730, meanbuyprice_withTax = 365, lastbuyprice_withDiscountAndTax = 730
                where buybilldetailid = 709;
UPDATE productunit SET proUnitBuyPrice  = 730 * productnumber WHERE productid = 1853;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2870';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1853', '1', '24', '0', '111', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4754
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 ('01854', '111', '143', '1854', '24.00', '780', '18720.00', '0.00', '', '2026-10-12 13:36:37', '1854','','','0','0','0','0','0',null,'780','18720','0','0','0','0','0','0','0','0','1'); -- id=710
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:16:12', 1, 1854, 0, 0
                    , 780, 24, 0, 0, 1, '2026-10-12 13:36:37')
                ON DUPLICATE KEY UPDATE buyprice = 780,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:36:37' ; -- id=901
UPDATE product SET  productBuyPrice = "780" WHERE productId = 1854 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 710 ;
UPDATE product SET productName = 'جاكيت 599 او ار', productDescription = '', productCatId = '143', productBuyPrice = '780.00', productSellAllPrice = '810.00', productSellUnitPrice = '810.00', productSellHalfPrice = '810.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01854',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '780',lastbuyprice_withDiscount = '780',meanbuyprice = '780',meanbuyprice_withDiscount = '780' , productbuypricereal = '780.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.85' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='779.93',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='780',meanbuyprice_withTax='390',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='780',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1854';
UPDATE buybilldetail SET  lastbuyprice = 780 , meanbuyprice = 780, lastbuyprice_withDiscount = 780, meanbuyprice_withDiscount = 780
        , lastbuyprice_withTax = 780, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 780
                where buybilldetailid = 710;
UPDATE productunit SET proUnitBuyPrice  = 780 * productnumber WHERE productid = 1854;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2871';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1854', '1', '24', '0', '111', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:16:12','0','0'); -- id=4755
DELETE FROM productserial WHERE billid = 109
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '132920',suppliercurrentDebtInCurrency= '132920' , userid = '1', supplierdate = '2026-10-12 13:36:37'   WHERE supplierid = '147';
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 ('147', '-100000.00', '232920', '0', 'اضافة فاتورة مشتريات', '111', '132920', '2026-10-12 13:36:37', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','232900','1','-100000','232920','132920','0',''); -- id=385
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '232920', '232920', '2026-10-12', '1', '0', '0', '2026-10-12 13:36:37','اضافة فاتورة مشتريات رقم 111','1','0',null,'0','111','buyBillController.php?do=details&id=111'); -- id=2112
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2112', '382', '232920', '','0'); -- id=2154
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20074540.97', 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 ('2112', '630', '232920', '','0'); -- id=2114
UPDATE accountstree SET name = 'او ار', customName = 'او ار', customNameEn = 'او ار', nameEn = 'او ار', parent = '81', accountNature = '1', theValue = '132920', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-09 21:33:59' WHERE id = '630';
update buybill set dailyentryid='2112,0' where buybillid=111;
UPDATE product SET overAllAveragePrice = 740 WHERE productId = 1842;UPDATE product SET overAllAveragePrice = 740 WHERE productId = 1843;UPDATE product SET overAllAveragePrice = 770 WHERE productId = 1844;UPDATE product SET overAllAveragePrice = 740 WHERE productId = 1845;UPDATE product SET overAllAveragePrice = 600 WHERE productId = 1846;UPDATE product SET overAllAveragePrice = 750 WHERE productId = 1847;UPDATE product SET overAllAveragePrice = 750 WHERE productId = 1848;UPDATE product SET overAllAveragePrice = 650 WHERE productId = 1849;UPDATE product SET overAllAveragePrice = 740 WHERE productId = 1850;UPDATE product SET overAllAveragePrice = 740 WHERE productId = 1851;UPDATE product SET overAllAveragePrice = 750 WHERE productId = 1852;UPDATE product SET overAllAveragePrice = 730 WHERE productId = 1853;UPDATE product SET overAllAveragePrice = 780 WHERE productId = 1854;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:06:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:36:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:36:38', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=111'); -- id=7641
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:07:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:37:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 13:37:31', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7642
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:08:01";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:38:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 13:38:01', '1', 'add2', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=7643
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-10-12','','93', '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=145
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (145, 1,'2026-10-12 13:38:01',1)
                ON DUPLICATE KEY UPDATE catid = 145, edited = 1, sysdate = '2026-10-12 13:38:01', userid = 1; -- id=157
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:08:01";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:38:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 13:38:01', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=7644
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:08:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:38:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 13:38:03', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=7645
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:08:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:38:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:38:07', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7646
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:09:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:39:28", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:39:28', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7647
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:10:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:40:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:40:03', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=7648
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:10:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:40:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:40:07', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7649

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accb7c40e993
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 13:40:07', '06accb7c40e993', '1', '0.00', '0', '10', '1', '7230.00', '7220', '7220', '0', '1', '2026-10-12 13:40:07', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '24' ,'0','','','','','-1','0','0','0','0','0','7220','0','','0','0','7220','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=433
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','اضافة فاتورة مبيعات','433', '0', '2026-10-12 13:40:07', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '7220', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 13:40:07','0','0','',''); -- id=565
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 502;
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 ('316.2','01660', '433', '125', '1660', '6', '340', '2040', '0', '', '0', '2026-10-12 13:40:07', '1660', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','502-6,','1','1','0','0','340','2040','0','','0','0.00','0','0','0','0'); -- id=1542
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 316.20, meanbuyprice_withDiscount = 316.20
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 316.2
                where sellbilldetailid = 1542;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1660, '2026-10-12', 2037.1784232365, 2040, 2040
                    , 2040, 1897.2, 1897.2, 1897.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2040, 2040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2037.1784232365, sellCostBuyPrice =sellCostBuyPrice+2040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1897.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1897.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1897.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2037.1784232365, 2040, 2040
                    , 2040, 1897.2, 1897.2, 1897.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2040, 2040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2037.1784232365, sellCostBuyPrice =sellCostBuyPrice+2040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1897.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1897.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1897.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '129', userid = '2', storedetaildate = '2026-10-12 13:40:07' WHERE storedetailid = '2672';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1660', '1', '6', '1', '433', 'اضافة فاتورة مبيعات', 'sellbillController.php', '135', '129', '2', '2026-10-12 13:40:07','0','0'); -- id=4756
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 501;
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 ('344.1','01656', '433', '125', '1656', '3', '370', '1110', '0', '', '0', '2026-10-12 13:40:07', '1656', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','501-3,','1','1','0','0','370','1110','0','','0','0.00','0','0','0','0'); -- id=1543
UPDATE sellbilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 344.10, meanbuyprice_withDiscount = 344.10
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 344.1
                where sellbilldetailid = 1543;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1656, '2026-10-12', 1108.4647302905, 1110, 1110
                    , 1110, 1032.3, 1032.3, 1032.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1110, 1110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1108.4647302905, sellCostBuyPrice =sellCostBuyPrice+1110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1032.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1032.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1032.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1110
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1108.4647302905, 1110, 1110
                    , 1110, 1032.3, 1032.3, 1032.3
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1110, 1110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1108.4647302905, sellCostBuyPrice =sellCostBuyPrice+1110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1032.3, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1032.3
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1032.3
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1110
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '60', userid = '2', storedetaildate = '2026-10-12 13:40:07' WHERE storedetailid = '2668';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1656', '1', '3', '1', '433', 'اضافة فاتورة مبيعات', 'sellbillController.php', '63', '60', '2', '2026-10-12 13:40:07','0','0'); -- id=4757
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 70;
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','01378', '433', '94', '1378', '3', '360', '1080', '0', '', '0', '2026-10-12 13:40:07', '1378', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','70-3,','1','1','0','0','360','1080','0','','0','0.00','0','0','0','0'); -- id=1544
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 = 1544;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1378, '2026-10-12', 1078.5062240664, 960, 960
                    , 960, 960, 960, 960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 960, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1078.5062240664, sellCostBuyPrice =sellCostBuyPrice+960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1078.5062240664, 960, 960
                    , 960, 960, 960, 960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 960, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1078.5062240664, sellCostBuyPrice =sellCostBuyPrice+960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '588', userid = '2', storedetaildate = '2026-10-12 13:40:07' WHERE storedetailid = '1378';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1378', '1', '3', '1', '433', 'اضافة فاتورة مبيعات', 'sellbillController.php', '591', '588', '2', '2026-10-12 13:40:07','0','0'); -- id=4758
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 866;
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','01841', '433', '142', '1841', '12', '250', '3000', '0', '', '0', '2026-10-12 13:40:07', '1841', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','866-12,','1','1','0','0','250','3000','0','','0','0.00','0','0','0','0'); -- id=1545
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 117.5, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 1545;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1841, '2026-10-12', 2995.8506224066, 2820, 2820
                    , 2820, 2820, 2820, 2820
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 2820, 1410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2995.8506224066, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2820, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2820
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2995.8506224066, 2820, 2820
                    , 2820, 2820, 2820, 2820
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2820, 1410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2995.8506224066, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2820, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2820
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '201', userid = '2', storedetaildate = '2026-10-12 13:40:07' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '12', '1', '433', 'اضافة فاتورة مبيعات', 'sellbillController.php', '213', '201', '2', '2026-10-12 13:40:07','0','0'); -- id=4759
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2515190',  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 ('2507970','7220', '0', '2', 'اضافة فاتورة مبيعات', '433', '2515190', '2026-10-12 13:40:07', '2',  'sellbillController.php','1','','0'); -- id=538
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7230', '7230', '2026-10-12', '2', '0', '0', '2026-10-12 13:40:07','اضافة فاتورة مبيعات رقم 433','1','0',null,'0','433','sellbillController.php?do=showDetail&sellbillid=433'); -- id=2113
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2113', '419', '7220', '','0'); -- id=2155
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2515190', 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 ('2113', '398', '10', '','0'); -- id=2156
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '464675', theOrder = '0', layingOrder = '51', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-08-08 17:58:26' WHERE id = '398';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2113', '143', '7230', '','0'); -- id=2115
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4342520', 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 ( '6709.5', '6709.5', '2026-10-12', '2', '0', '0', '2026-10-12 13:40:07','اضافة فاتورة مبيعات رقم 433 - صرف البضاعة من المخزن','1','0',null,'0','433','sellbillController.php?do=showDetail&sellbillid=433'); -- id=2114
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2114', '402', '6709.5', '','0'); -- id=2157
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4056449.23', 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 ('2114', '382', '6709.5', '','0'); -- id=2116
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20067831.47', 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='2113,0,2114' where sellbillid=433;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 7220, 6930, 6930
                    , 6930, 6709.5, 6709.5, 6709.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6930, 5520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7220, sellCostBuyPrice =sellCostBuyPrice+6930
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6930, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6930
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6709.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6709.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6709.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6930
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 7220, 6930, 6930
                    , 6930, 6709.5, 6709.5, 6709.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6930, 5520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7220, sellCostBuyPrice =sellCostBuyPrice+6930
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6930, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6930
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6709.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6709.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6709.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6930
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5520
                        , returnSellVal = returnSellVal+0, 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, 7220, 6930, 6930
                    , 6930, 6709.5, 6709.5, 6709.5, 6930, 5520)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+7220, netSellCostBuyPrice = netSellCostBuyPrice+6930
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6930
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6930
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6709.5
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6709.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6709.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6930
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5520;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accb7c40e993 and sellbillId = 433 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:10:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:40:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:40:08', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7650
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:10:14";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:40:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:40:14', '1', 'editbill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=105'); -- id=7651
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:10:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:40:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:40:23', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7652
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:10:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:40:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:40:28', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7653
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:10:48";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:40:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:40:48', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7654
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:11:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:41:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:41:00', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7655
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:11:04";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:41:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:41:04', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=7656
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 ('بوكس فيت الهضبه ','','145','415','450','450','450','2026-10-12','0','1','0','','0','0','0','0','0','415','415','415','415','415','0','8.43','0','0','.','0','0','0','415','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','415','415','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','415','0','0','0','0','0','0','','','0','0','0','0'); -- id=1857
UPDATE product SET productName = 'بوكس فيت الهضبه ', productDescription = '', productCatId = '145', productBuyPrice = '415', productSellAllPrice = '450', productSellUnitPrice = '450', productSellHalfPrice = '450', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01857',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '415',lastbuyprice_withDiscount = '415',meanbuyprice = '415',meanbuyprice_withDiscount = '415' , productbuypricereal = '415' , buypricereal_precentage = '0' , buytotal_precentage = '8.43' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='415',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='415',meanbuyprice_withTax='415',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='415',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1857';
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', '1857', '1', '2026-10-12', '1', '0','0185701','450','450','450','415','','0','0','0','0','0','0','0','0','0','0'); -- id=1857
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1857', '1', '0', '1', '2026-10-12'); -- id=2874
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1857', '1', '0', '0', '1857', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4760
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1857, 1,'2026-10-12 13:41:04',1)
                ON DUPLICATE KEY UPDATE productid = 1857, edited = 1, sysdate = '2026-10-12 13:41:04', userid = 1; -- id=2779
UPDATE product SET productName = 'بوكس فيت الهضبه ', productDescription = '', productCatId = '145', productBuyPrice = '415.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01857',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '415',lastbuyprice_withDiscount = '415',meanbuyprice = '415',meanbuyprice_withDiscount = '415' , productbuypricereal = '415' , buypricereal_precentage = '0' , buytotal_precentage = '8.43' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='415',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='415',meanbuyprice_withTax='415',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='415',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1857';
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 ('بوكس فيت حوض الهضبه','','145','345','360','360','360','2026-10-12','0','1','0','','0','0','0','0','0','345','345','345','345','345','0','4.35','0','0','.','0','0','0','345','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','345','345','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','345','0','0','0','0','0','0','','','0','0','0','0'); -- id=1858
UPDATE product SET productName = 'بوكس فيت حوض الهضبه', productDescription = '', productCatId = '145', productBuyPrice = '345', productSellAllPrice = '360', productSellUnitPrice = '360', productSellHalfPrice = '360', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01858',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '345',lastbuyprice_withDiscount = '345',meanbuyprice = '345',meanbuyprice_withDiscount = '345' , productbuypricereal = '345' , buypricereal_precentage = '0' , buytotal_precentage = '4.35' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='345',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='345',meanbuyprice_withTax='345',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='345',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1858';
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', '1858', '1', '2026-10-12', '1', '0','0185801','360','360','360','345','','0','0','0','0','0','0','0','0','0','0'); -- id=1858
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1858', '1', '0', '1', '2026-10-12'); -- id=2875
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1858', '1', '0', '0', '1858', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4761
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1858, 1,'2026-10-12 13:41:04',1)
                ON DUPLICATE KEY UPDATE productid = 1858, edited = 1, sysdate = '2026-10-12 13:41:04', userid = 1; -- id=2780
UPDATE product SET productName = 'بوكس فيت حوض الهضبه', productDescription = '', productCatId = '145', productBuyPrice = '345.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01858',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '345',lastbuyprice_withDiscount = '345',meanbuyprice = '345',meanbuyprice_withDiscount = '345' , productbuypricereal = '345' , buypricereal_precentage = '0' , buytotal_precentage = '4.35' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='345',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='345',meanbuyprice_withTax='345',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='345',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1858';
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 ('بوكس فيت سوسته الهضبه ','','145','455','470','470','470','2026-10-12','0','1','0','','0','0','0','0','0','455','455','455','455','455','0','3.3','0','0','.','0','0','0','455','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','455','455','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','455','0','0','0','0','0','0','','','0','0','0','0'); -- id=1859
UPDATE product SET productName = 'بوكس فيت سوسته الهضبه ', productDescription = '', productCatId = '145', productBuyPrice = '455', productSellAllPrice = '470', productSellUnitPrice = '470', productSellHalfPrice = '470', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01859',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455',lastbuyprice_withDiscount = '455',meanbuyprice = '455',meanbuyprice_withDiscount = '455' , productbuypricereal = '455' , buypricereal_precentage = '0' , buytotal_precentage = '3.3' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',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='455',meanbuyprice_withTax='455',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='455',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1859';
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', '1859', '1', '2026-10-12', '1', '0','0185901','470','470','470','455','','0','0','0','0','0','0','0','0','0','0'); -- id=1859
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1859', '1', '0', '1', '2026-10-12'); -- id=2876
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1859', '1', '0', '0', '1859', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4762
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1859, 1,'2026-10-12 13:41:04',1)
                ON DUPLICATE KEY UPDATE productid = 1859, edited = 1, sysdate = '2026-10-12 13:41:04', userid = 1; -- id=2781
UPDATE product SET productName = 'بوكس فيت سوسته الهضبه ', productDescription = '', productCatId = '145', productBuyPrice = '455.00', productSellAllPrice = '470.00', productSellUnitPrice = '470.00', productSellHalfPrice = '470.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01859',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455',lastbuyprice_withDiscount = '455',meanbuyprice = '455',meanbuyprice_withDiscount = '455' , productbuypricereal = '455' , buypricereal_precentage = '0' , buytotal_precentage = '3.3' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',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='455',meanbuyprice_withTax='455',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='455',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1859';
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 ('بوكس سوسته الهضبه ','','145','455','470','470','470','2026-10-12','0','1','0','','0','0','0','0','0','455','455','455','455','455','0','3.3','0','0','.','0','0','0','455','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','455','455','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','455','0','0','0','0','0','0','','','0','0','0','0'); -- id=1860
UPDATE product SET productName = 'بوكس سوسته الهضبه ', productDescription = '', productCatId = '145', productBuyPrice = '455', productSellAllPrice = '470', productSellUnitPrice = '470', productSellHalfPrice = '470', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01860',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455',lastbuyprice_withDiscount = '455',meanbuyprice = '455',meanbuyprice_withDiscount = '455' , productbuypricereal = '455' , buypricereal_precentage = '0' , buytotal_precentage = '3.3' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',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='455',meanbuyprice_withTax='455',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='455',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1860';
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', '1860', '1', '2026-10-12', '1', '0','0186001','470','470','470','455','','0','0','0','0','0','0','0','0','0','0'); -- id=1860
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1860', '1', '0', '1', '2026-10-12'); -- id=2877
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1860', '1', '0', '0', '1860', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4763
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1860, 1,'2026-10-12 13:41:04',1)
                ON DUPLICATE KEY UPDATE productid = 1860, edited = 1, sysdate = '2026-10-12 13:41:04', userid = 1; -- id=2782
UPDATE product SET productName = 'بوكس سوسته الهضبه ', productDescription = '', productCatId = '145', productBuyPrice = '455.00', productSellAllPrice = '470.00', productSellUnitPrice = '470.00', productSellHalfPrice = '470.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01860',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455',lastbuyprice_withDiscount = '455',meanbuyprice = '455',meanbuyprice_withDiscount = '455' , productbuypricereal = '455' , buypricereal_precentage = '0' , buytotal_precentage = '3.3' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',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='455',meanbuyprice_withTax='455',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='455',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1860';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:11:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:41:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:41:06', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7657
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:11:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:41:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:41:08', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7658
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:11:09";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:41:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:41:09', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7659
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:11:21";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:41:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:41:21', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7660
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-10-12 13:41:27', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=155
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 ('155', '0', '', '0', 'إضافة مورد جديد', '155', '', '2026-10-12 13:41:27', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=386
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-10-12 13:41:27'); -- id=638
UPDATE supplier SET suppliername = 'الهضبه', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-12', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='638',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '155';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:11:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:41:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:41:31', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7661
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:11:47";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:41:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:41:47', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7662
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:11:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:41:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:41:58', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7663
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:12:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:42:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 13:42:06', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=7664
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:12:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:42:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 13:42:18', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=7665
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:12:32";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:42:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 13:42:32', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=7666
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:12:50";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:42:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 13:42:50', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=7667
UPDATE productunit SET unitid = '1', productid = '1858', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0185801',proUnitSellAllPrice='360',proUnitSellHalfPrice='360',proUnitSellUnitPrice ='360',proUnitBuyPrice='345',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1858';
UPDATE product SET productName = 'بوكس فيت حوض الهضبه', productDescription = '', productCatId = '145', productBuyPrice = '325', productSellAllPrice = '360', productSellUnitPrice = '360', productSellHalfPrice = '360', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01858',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '345.00',lastbuyprice_withDiscount = '345',meanbuyprice = '345.00',meanbuyprice_withDiscount = '345' , productbuypricereal = '345' , buypricereal_precentage = '0' , buytotal_precentage = '4.35' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='345',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='345',meanbuyprice_withTax='345',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='345',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1858';
UPDATE productunit SET unitid = '1', productid = '1859', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0185901',proUnitSellAllPrice='470',proUnitSellHalfPrice='470',proUnitSellUnitPrice ='470',proUnitBuyPrice='455',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1859';
UPDATE product SET productName = 'بوكس فيت سوسته الهضبه ', productDescription = '', productCatId = '145', productBuyPrice = '435', productSellAllPrice = '470', productSellUnitPrice = '470', productSellHalfPrice = '470', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01859',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455.00',lastbuyprice_withDiscount = '455',meanbuyprice = '455.00',meanbuyprice_withDiscount = '455' , productbuypricereal = '455' , buypricereal_precentage = '0' , buytotal_precentage = '3.3' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',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='455',meanbuyprice_withTax='455',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='455',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1859';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:14:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:44:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 13:44:49', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=7668
UPDATE productunit SET unitid = '1', productid = '1860', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0186001',proUnitSellAllPrice='470',proUnitSellHalfPrice='470',proUnitSellUnitPrice ='470',proUnitBuyPrice='455',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1860';
UPDATE product SET productName = 'بوكس سوسته الهضبه ', productDescription = '', productCatId = '145', productBuyPrice = '435', productSellAllPrice = '470', productSellUnitPrice = '470', productSellHalfPrice = '470', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01860',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455.00',lastbuyprice_withDiscount = '455',meanbuyprice = '455.00',meanbuyprice_withDiscount = '455' , productbuypricereal = '455' , buypricereal_precentage = '0' , buytotal_precentage = '3.3' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',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='455',meanbuyprice_withTax='455',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='455',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1860';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:15:43";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:45:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:45:43', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=7669
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 ('06accb944309c2', '2026-10-12 13:41:08', '155', '0.00', '34845', '0', '0', '34845.00',  '34845.00', '0', '34845', '1', '2026-10-12 13:45:43', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=112
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 ('01857', '112', '145', '1857', '18', '415', '7470.00', '0', '', '2026-10-12 13:45:43', '1857','','','0','0','0','0','0',null,'415','7470','0','0','0','0','0','0','0','0','1'); -- id=711
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:41:08', 1, 1857, 0, 0
                    , 415, 18, 0, 0, 1, '2026-10-12 13:45:43')
                ON DUPLICATE KEY UPDATE buyprice = 415,
                        buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:45:43' ; -- id=930
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1857', '415', '18', '0', 'buyBillController.php', '711', '', '0', '0'); -- id=548
UPDATE product SET  productBuyPrice = "415" WHERE productId = 1857 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 711 ;
UPDATE product SET productName = 'بوكس فيت الهضبه ', productDescription = '', productCatId = '145', productBuyPrice = '415.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01857',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '415',lastbuyprice_withDiscount = '415',meanbuyprice = '415',meanbuyprice_withDiscount = '415' , productbuypricereal = '415.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.43' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='415',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='415',meanbuyprice_withTax='415',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='415',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1857';
UPDATE buybilldetail SET  lastbuyprice = 415 , meanbuyprice = 415, lastbuyprice_withDiscount = 415, meanbuyprice_withDiscount = 415
        , lastbuyprice_withTax = 415, meanbuyprice_withTax = 415, lastbuyprice_withDiscountAndTax = 415
                where buybilldetailid = 711;
UPDATE productunit SET proUnitBuyPrice  = 415 * productnumber WHERE productid = 1857;
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2874';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1857', '1', '18', '0', '112', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '18', '1', '2026-10-12 13:41:08','0','0'); -- id=4764
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 ('01858', '112', '145', '1858', '24', '325', '7800.00', '0', '', '2026-10-12 13:45:43', '1858','','','0','0','0','0','0',null,'325','7800','0','0','0','0','0','0','0','0','1'); -- id=712
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:41:08', 1, 1858, 0, 0
                    , 325, 24, 0, 0, 1, '2026-10-12 13:45:43')
                ON DUPLICATE KEY UPDATE buyprice = 325,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:45:43' ; -- id=931
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1858', '325', '24', '0', 'buyBillController.php', '712', '', '0', '0'); -- id=549
UPDATE product SET  productBuyPrice = "325" WHERE productId = 1858 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 712 ;
UPDATE product SET productName = 'بوكس فيت حوض الهضبه', productDescription = '', productCatId = '145', productBuyPrice = '325.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01858',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '325',lastbuyprice_withDiscount = '325',meanbuyprice = '325',meanbuyprice_withDiscount = '325' , productbuypricereal = '345.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='345',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='325',meanbuyprice_withTax='325',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='325',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1858';
UPDATE buybilldetail SET  lastbuyprice = 325 , meanbuyprice = 325, lastbuyprice_withDiscount = 325, meanbuyprice_withDiscount = 325
        , lastbuyprice_withTax = 325, meanbuyprice_withTax = 325, lastbuyprice_withDiscountAndTax = 325
                where buybilldetailid = 712;
UPDATE productunit SET proUnitBuyPrice  = 325 * productnumber WHERE productid = 1858;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2875';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1858', '1', '24', '0', '112', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:41:08','0','0'); -- id=4765
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 ('01859', '112', '145', '1859', '24', '435', '10440.00', '0', '', '2026-10-12 13:45:43', '1859','','','0','0','0','0','0',null,'435','10440','0','0','0','0','0','0','0','0','1'); -- id=713
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:41:08', 1, 1859, 0, 0
                    , 435, 24, 0, 0, 1, '2026-10-12 13:45:43')
                ON DUPLICATE KEY UPDATE buyprice = 435,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:45:43' ; -- id=932
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1859', '435', '24', '0', 'buyBillController.php', '713', '', '0', '0'); -- id=550
UPDATE product SET  productBuyPrice = "435" WHERE productId = 1859 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 713 ;
UPDATE product SET productName = 'بوكس فيت سوسته الهضبه ', productDescription = '', productCatId = '145', productBuyPrice = '435.00', productSellAllPrice = '470.00', productSellUnitPrice = '470.00', productSellHalfPrice = '470.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01859',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '435',lastbuyprice_withDiscount = '435',meanbuyprice = '435',meanbuyprice_withDiscount = '435' , productbuypricereal = '455.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.30' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',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='435',meanbuyprice_withTax='435',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='435',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1859';
UPDATE buybilldetail SET  lastbuyprice = 435 , meanbuyprice = 435, lastbuyprice_withDiscount = 435, meanbuyprice_withDiscount = 435
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 435, lastbuyprice_withDiscountAndTax = 435
                where buybilldetailid = 713;
UPDATE productunit SET proUnitBuyPrice  = 435 * productnumber WHERE productid = 1859;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2876';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1859', '1', '24', '0', '112', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 13:41:08','0','0'); -- id=4766
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 ('01860', '112', '145', '1860', '21', '435', '9135.00', '0', '', '2026-10-12 13:45:43', '1860','','','0','0','0','0','0',null,'435','9135','0','0','0','0','0','0','0','0','1'); -- id=714
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 13:41:08', 1, 1860, 0, 0
                    , 435, 21, 0, 0, 1, '2026-10-12 13:45:43')
                ON DUPLICATE KEY UPDATE buyprice = 435,
                        buyQuantity =buyQuantity+21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 13:45:43' ; -- id=933
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1860', '435', '21', '0', 'buyBillController.php', '714', '', '0', '0'); -- id=551
UPDATE product SET  productBuyPrice = "435" WHERE productId = 1860 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 714 ;
UPDATE product SET productName = 'بوكس سوسته الهضبه ', productDescription = '', productCatId = '145', productBuyPrice = '435.00', productSellAllPrice = '470.00', productSellUnitPrice = '470.00', productSellHalfPrice = '470.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01860',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '435',lastbuyprice_withDiscount = '435',meanbuyprice = '435',meanbuyprice_withDiscount = '435' , productbuypricereal = '455.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.30' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',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='435',meanbuyprice_withTax='435',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='435',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1860';
UPDATE buybilldetail SET  lastbuyprice = 435 , meanbuyprice = 435, lastbuyprice_withDiscount = 435, meanbuyprice_withDiscount = 435
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 435, lastbuyprice_withDiscountAndTax = 435
                where buybilldetailid = 714;
UPDATE productunit SET proUnitBuyPrice  = 435 * productnumber WHERE productid = 1860;
UPDATE storedetail SET  productquantity = '21', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2877';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1860', '1', '21', '0', '112', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '21', '1', '2026-10-12 13:41:08','0','0'); -- id=4767
UPDATE supplier SET  suppliercurrentDebt = '34845',suppliercurrentDebtInCurrency= '34845' , userid = '1', supplierdate = '2026-10-12 13:45:43'   WHERE supplierid = '155';
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 ('155', '0.00', '34845', '0', 'اضافة فاتورة مشتريات', '112', '34845', '2026-10-12 13:41:08', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','34845','1','0','34845','34845','0',''); -- id=387
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '34845', '34845', '2026-10-12', '1', '0', '0', '2026-10-12 13:45:43','اضافة فاتورة مشتريات رقم 112','1','0',null,'0','112','buyBillController.php?do=details&id=112'); -- id=2115
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2115', '382', '34845', '','0'); -- id=2158
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20102676.47', 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 ('2115', '638', '34845', '','0'); -- id=2117
UPDATE accountstree SET name = 'الهضبه', customName = 'الهضبه', customNameEn = 'الهضبه', nameEn = 'الهضبه', parent = '81', accountNature = '1', theValue = '34845', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 13:41:27' WHERE id = '638';
update buybill set dailyentryid='2115,0' where buybillid=112;
COMMIT;
UPDATE product SET overAllAveragePrice = 415 WHERE productId = 1857;UPDATE product SET overAllAveragePrice = 325 WHERE productId = 1858;UPDATE product SET overAllAveragePrice = 435 WHERE productId = 1859;UPDATE product SET overAllAveragePrice = 435 WHERE productId = 1860;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:15:43";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:45:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:45:43', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=112'); -- id=7670
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:15:48";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:45:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:45:48', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7671
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:15:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:45:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 13:45:58', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=7672
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:16:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:46:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 13:46:16', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=7673
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:16:40";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:46:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 13:46:40', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=7674
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:16:55";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:46:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 13:46:55', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=7675
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:17:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:47:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 13:47:08', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=7676
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:17:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:47:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 13:47:23', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=7677
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:17:36";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:47:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 13:47:36', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=7678
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:17:46";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:47:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:47:46', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7679
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:18:30";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:48:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 13:48:30', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7680
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:19:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:49:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 13:49:17', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7681
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:19:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:49:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:49:18', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=112'); -- id=7682
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:19:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:49:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 13:49:20', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7683
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:19:34";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:19:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:49:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 13:49:38', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7684
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:19:38";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 13:49:38', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7685
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:27:05";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:57:05", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 13:57:05', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7686
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:27:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:57:06", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 13:57:06', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7687
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:29:11";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 13:59:11", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 13:59:11', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7688
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:30:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:00:20", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:00:20', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7689

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accbd7f71528
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 14:00:20', '06accbd7f71528', '1', '0.00', '0', '0', '1', '2700.00', '2700', '2700', '0', '1', '2026-10-12 14:00:20', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2700','0','','0','0','2700','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=434
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','434', '0', '2026-10-12 14:00:20', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2700', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 14:00:20','0','0','',''); -- id=566
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 560;
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 ('405','01696', '434', '129', '1696', '6', '450', '2700', '0', '', '0', '2026-10-12 14:00:20', '1696', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','560-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=1546
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 405.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 405
                where sellbilldetailid = 1546;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1696, '2026-10-12', 2700, 2700, 2700
                    , 2700, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2700, 2700, 2700
                    , 2700, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '123', userid = '6', storedetaildate = '2026-10-12 14:00:20' WHERE storedetailid = '2708';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1696', '1', '6', '1', '434', 'اضافة فاتورة مبيعات', 'sellbillController.php', '129', '123', '6', '2026-10-12 14:00:20','0','0'); -- id=4768
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '141290',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('138590','2700', '0', '4', 'اضافة فاتورة مبيعات', '434', '141290', '2026-10-12 14:00:20', '6',  'sellbillController.php','1','','0'); -- id=539
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2700', '2700', '2026-10-12', '6', '0', '0', '2026-10-12 14:00:20','اضافة فاتورة مبيعات رقم 434','1','0',null,'0','434','sellbillController.php?do=showDetail&sellbillid=434'); -- id=2116
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2116', '568', '2700', '','0'); -- id=2159
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '141290', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2116', '143', '2700', '','0'); -- id=2118
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4345220', 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 ( '2430', '2430', '2026-10-12', '6', '0', '0', '2026-10-12 14:00:20','اضافة فاتورة مبيعات رقم 434 - صرف البضاعة من المخزن','1','0',null,'0','434','sellbillController.php?do=showDetail&sellbillid=434'); -- id=2117
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2117', '402', '2430', '','0'); -- id=2160
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4058879.23', 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 ('2117', '382', '2430', '','0'); -- id=2119
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20100246.47', 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='2116,0,2117' where sellbillid=434;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2700, 2700, 2700
                    , 2700, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2700, 2700, 2700
                    , 2700, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, 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, 2700, 2700, 2700
                    , 2700, 2430, 2430, 2430, 2700, 2700)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2700, netSellCostBuyPrice = netSellCostBuyPrice+2700
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2700
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2700
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2430
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2430
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2430
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2700
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2700;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accbd7f71528 and sellbillId = 434 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:30:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:00:20", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:00:20', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7690
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:30:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:00:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:00:45', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7691
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:31:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:01:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 14:01:06', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7692
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:31:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:01:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:01:49', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7693
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:33:25";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:03:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:03:25', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7694

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accb9083375a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 14:03:25', '06accb9083375a', '1', '0.00', '0', '0', '1', '9445.00', '9445', '9445', '0', '1', '2026-10-12 14:03:25', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '25' ,'0','','','','','-1','0','0','0','0','0','9445','0','','0','0','9445','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=435
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','اضافة فاتورة مبيعات','435', '0', '2026-10-12 14:03:25', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '9445', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 14:03:25','0','0','',''); -- id=567
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 355;
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 ('276','01467', '435', '104', '1467', '4', '340', '1360', '0', '', '0', '2026-10-12 14:03:25', '1467', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','355-4,','1','1','0','0','340','1360','0','','0','0.00','0','0','0','0'); -- id=1547
UPDATE sellbilldetail SET  lastbuyprice = 276.00 , meanbuyprice = 276.00, lastbuyprice_withDiscount = 276.00, meanbuyprice_withDiscount = 276.00
        , lastbuyprice_withTax = 276, meanbuyprice_withTax = 276, lastbuyprice_withDiscountAndTax = 276
                where sellbilldetailid = 1547;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1467, '2026-10-12', 1360, 1104, 1104
                    , 1104, 1104, 1104, 1104
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1104, 1104, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1360, sellCostBuyPrice =sellCostBuyPrice+1104
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1104, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1104
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1104, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1104
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1104
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1104
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1104
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1360, 1104, 1104
                    , 1104, 1104, 1104, 1104
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1104, 1104, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1360, sellCostBuyPrice =sellCostBuyPrice+1104
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1104, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1104
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1104, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1104
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1104
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1104
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1104
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '596', userid = '2', storedetaildate = '2026-10-12 14:03:25' WHERE storedetailid = '1492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '4', '1', '435', 'اضافة فاتورة مبيعات', 'sellbillController.php', '600', '596', '2', '2026-10-12 14:03:25','0','0'); -- id=4769
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 73;
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 ('260','01381', '435', '94', '1381', '3', '295', '885', '0', '', '0', '2026-10-12 14:03:25', '1381', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','73-3,','1','1','0','0','295','885','0','','0','0.00','0','0','0','0'); -- id=1548
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 1548;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1381, '2026-10-12', 885, 780, 780
                    , 780, 780, 780, 780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 780, 780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+885, sellCostBuyPrice =sellCostBuyPrice+780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 885, 780, 780
                    , 780, 780, 780, 780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 780, 780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+885, sellCostBuyPrice =sellCostBuyPrice+780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '282', userid = '2', storedetaildate = '2026-10-12 14:03:25' WHERE storedetailid = '1381';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1381', '1', '3', '1', '435', 'اضافة فاتورة مبيعات', 'sellbillController.php', '285', '282', '2', '2026-10-12 14:03:25','0','0'); -- id=4770
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 303;
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 ('405','01525', '435', '111', '1525', '6', '450', '2700', '0', '', '0', '2026-10-12 14:03:25', '1525', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','303-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=1549
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 405.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 405
                where sellbilldetailid = 1549;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1525, '2026-10-12', 2700, 2700, 2700
                    , 2700, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2700, 2700, 2700
                    , 2700, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '2', storedetaildate = '2026-10-12 14:03:25' WHERE storedetailid = '1550';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1525', '1', '6', '1', '435', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '22', '2', '2026-10-12 14:03:25','0','0'); -- id=4771
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 572;
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 ('322','01709', '435', '128', '1709', '6', '350', '2100', '0', '', '0', '2026-10-12 14:03:25', '1709', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','572-6,','1','1','0','0','350','2100','0','','0','0.00','0','0','0','0'); -- id=1550
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 322.00, meanbuyprice_withDiscount = 336.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 322
                where sellbilldetailid = 1550;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1709, '2026-10-12', 2100, 2100, 2100
                    , 2100, 1932, 2016, 1932
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2100, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1932, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2016
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1932
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2100
                            , 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+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-10-12', 2100, 2100, 2100
                    , 2100, 1932, 2016, 1932
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2100, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1932, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2016
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1932
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2100
                            , 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 = '15', userid = '2', storedetaildate = '2026-10-12 14:03:25' WHERE storedetailid = '2721';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1709', '1', '6', '1', '435', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '15', '2', '2026-10-12 14:03:25','0','0'); -- id=4772
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 275;
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 ('378','01469', '435', '105', '1469', '3', '420', '1260', '0', '', '0', '2026-10-12 14:03:25', '1469', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','275-3,','1','1','0','0','420','1260','0','','0','0.00','0','0','0','0'); -- id=1551
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 378.00, meanbuyprice_withDiscount = 378.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 378
                where sellbilldetailid = 1551;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1469, '2026-10-12', 1260, 1260, 1260
                    , 1260, 1134, 1134, 1134
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1134, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1134
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1134
                            , 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+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-10-12', 1260, 1260, 1260
                    , 1260, 1134, 1134, 1134
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1134, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1134
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1134
                            , 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 = '99', userid = '2', storedetaildate = '2026-10-12 14:03:25' WHERE storedetailid = '1494';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1469', '1', '3', '1', '435', 'اضافة فاتورة مبيعات', 'sellbillController.php', '102', '99', '2', '2026-10-12 14:03:25','0','0'); -- id=4773
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 274;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('342','01468', '435', '105', '1468', '3', '380', '1140', '0', '', '0', '2026-10-12 14:03:25', '1468', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','274-3,','1','1','0','0','380','1140','0','','0','0.00','0','0','0','0'); -- id=1552
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 342.00, meanbuyprice_withDiscount = 342.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 342
                where sellbilldetailid = 1552;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1468, '2026-10-12', 1140, 1140, 1140
                    , 1140, 1026, 1026, 1026
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1140, 1140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1140, sellCostBuyPrice =sellCostBuyPrice+1140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1026, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1026
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1026
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1140, 1140, 1140
                    , 1140, 1026, 1026, 1026
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1140, 1140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1140, sellCostBuyPrice =sellCostBuyPrice+1140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1026, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1026
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1026
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '90', userid = '2', storedetaildate = '2026-10-12 14:03:25' WHERE storedetailid = '1493';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1468', '1', '3', '1', '435', 'اضافة فاتورة مبيعات', 'sellbillController.php', '93', '90', '2', '2026-10-12 14:03:25','0','0'); -- id=4774
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2524635',  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 ('2515190','9445', '0', '2', 'اضافة فاتورة مبيعات', '435', '2524635', '2026-10-12 14:03:25', '2',  'sellbillController.php','1','','0'); -- id=540
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '9445', '9445', '2026-10-12', '2', '0', '0', '2026-10-12 14:03:25','اضافة فاتورة مبيعات رقم 435','1','0',null,'0','435','sellbillController.php?do=showDetail&sellbillid=435'); -- id=2118
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2118', '419', '9445', '','0'); -- id=2161
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2524635', 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 ('2118', '143', '9445', '','0'); -- id=2120
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4354665', 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 ( '8406', '8406', '2026-10-12', '2', '0', '0', '2026-10-12 14:03:25','اضافة فاتورة مبيعات رقم 435 - صرف البضاعة من المخزن','1','0',null,'0','435','sellbillController.php?do=showDetail&sellbillid=435'); -- id=2119
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2119', '402', '8406', '','0'); -- id=2162
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4067285.23', 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 ('2119', '382', '8406', '','0'); -- id=2121
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20091840.47', 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='2118,0,2119' where sellbillid=435;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 9445, 9084, 9084
                    , 9084, 8406, 8490, 8406
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9084, 8034, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9445, sellCostBuyPrice =sellCostBuyPrice+9084
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9084, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9084
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8406, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8406
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9084
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8034
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 9445, 9084, 9084
                    , 9084, 8406, 8490, 8406
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9084, 8034, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9445, sellCostBuyPrice =sellCostBuyPrice+9084
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9084, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9084
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8406, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8406
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9084
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8034
                        , returnSellVal = returnSellVal+0, 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, 9445, 9084, 9084
                    , 9084, 8406, 8490, 8406, 9084, 8034)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+9445, netSellCostBuyPrice = netSellCostBuyPrice+9084
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+9084
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+9084
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8406
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+8490
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+8406
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+9084
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+8034;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accb9083375a and sellbillId = 435 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:33:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:03:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:03:26', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7695
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:38:04";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:08:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyreport.php', '2026-10-12 14:08:04', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyreport.php'); -- id=7696
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:38:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:08:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:08:06', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7697
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:38:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:08:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:08:18', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7698
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:38:55";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:08:55", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:08:55', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7699

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accbdc4e59b5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 14:08:55', '06accbdc4e59b5', '1', '0.00', '0', '0', '1', '1650.00', '1650', '1650', '0', '1', '2026-10-12 14:08:55', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1650','0','','0','0','1650','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=436
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','436', '0', '2026-10-12 14:08:55', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1650', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 14:08:55','0','0','',''); -- id=568
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 187;
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 ('495','01419', '436', '98', '1419', '3', '550', '1650', '0', '', '0', '2026-10-12 14:08:55', '1419', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','187-3,','1','1','0','0','550','1650','0','','0','0.00','0','0','0','0'); -- id=1553
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 522.50
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 275, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 1553;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1419, '2026-10-12', 1650, 1650, 1650
                    , 1650, 1485, 1567.5, 1485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1650, 825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1567.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+825
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1650, 1650, 1650
                    , 1650, 1485, 1567.5, 1485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1567.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+825
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-12 14:08:55' WHERE storedetailid = '1432';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1419', '1', '3', '1', '436', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '27', '6', '2026-10-12 14:08:55','0','0'); -- id=4775
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '142940',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('141290','1650', '0', '4', 'اضافة فاتورة مبيعات', '436', '142940', '2026-10-12 14:08:55', '6',  'sellbillController.php','1','','0'); -- id=541
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1650', '1650', '2026-10-12', '6', '0', '0', '2026-10-12 14:08:55','اضافة فاتورة مبيعات رقم 436','1','0',null,'0','436','sellbillController.php?do=showDetail&sellbillid=436'); -- id=2120
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2120', '568', '1650', '','0'); -- id=2163
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '142940', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2120', '143', '1650', '','0'); -- id=2122
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4356315', 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 ( '1485', '1485', '2026-10-12', '6', '0', '0', '2026-10-12 14:08:55','اضافة فاتورة مبيعات رقم 436 - صرف البضاعة من المخزن','1','0',null,'0','436','sellbillController.php?do=showDetail&sellbillid=436'); -- id=2121
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2121', '402', '1485', '','0'); -- id=2164
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4068770.23', 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 ('2121', '382', '1485', '','0'); -- id=2123
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20090355.47', 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='2120,0,2121' where sellbillid=436;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 1650, 1650, 1650
                    , 1650, 1485, 1567.5, 1485
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1650, 825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1567.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+825
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 1650, 1650, 1650
                    , 1650, 1485, 1567.5, 1485
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1650, 825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1567.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1485
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+825
                        , returnSellVal = returnSellVal+0, 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, 1650, 1650, 1650
                    , 1650, 1485, 1567.5, 1485, 1650, 825)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1650, netSellCostBuyPrice = netSellCostBuyPrice+1650
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1650
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1650
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1485
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1567.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1485
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1650
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+825;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accbdc4e59b5 and sellbillId = 436 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:38:56";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:08:56", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:08:56', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7700
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:39:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:09:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 14:09:15', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7701
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:39:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:09:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyreport.php', '2026-10-12 14:09:17', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyreport.php'); -- id=7702
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:39:21";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:09:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:09:21', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7703
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:39:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:09:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyreport.php', '2026-10-12 14:09:26', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyreport.php'); -- id=7704
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:39:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:09:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:09:28', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7705
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:40:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:10:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:10:12', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7706
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:40:24";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:10:24", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:10:24', '4', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7707

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accb3122df4d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 14:10:24', '06accb3122df4d', '1', '0.00', '0', '0', '1', '20280.00', '20280', '20280', '0', '2', '2026-10-12 14:10:24', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '52' ,'0','','','','','-1','0','0','0','0','0','20280','0','','0','0','20280','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=437
UPDATE client SET  clientdebt = '0', userid = '4' 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','اضافة فاتورة مبيعات','437', '0', '2026-10-12 14:10:24', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '20280', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 14:10:24','0','0','',''); -- id=569
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+36 where id = 131;
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','01324', '437', '86', '1324', '36', '390', '14040', '0', '', '0', '2026-10-12 14:10:24', '1324', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','131-36,','1','1','0','0','390','14040','0','','0','0.00','0','0','0','0'); -- id=1554
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 355.63, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 355.63
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 355.63, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 1554;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1324, '2026-10-12', 14040, 12960, 12960
                    , 12802.68, 12960, 12802.68, 12787.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 36, 0, 12960, 12802.68, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+14040, sellCostBuyPrice =sellCostBuyPrice+12960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12802.68
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12802.68
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12787.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+12960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+12802.68
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+36
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-12', 14040, 12960, 12960
                    , 12802.68, 12960, 12802.68, 12787.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12960, 12802.68, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+14040, sellCostBuyPrice =sellCostBuyPrice+12960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12802.68
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12802.68
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12787.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+12960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+12802.68
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '1470', userid = '4', storedetaildate = '2026-10-12 14:10:24' WHERE storedetailid = '1405';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1324', '2', '36', '1', '437', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1506', '1470', '4', '2026-10-12 14:10:24','0','0'); -- id=4776
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 147;
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 ('400','01356', '437', '88', '1356', '4', '420', '1680', '0', '', '0', '2026-10-12 14:10:24', '1356', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','147-4,','1','1','0','0','420','1680','0','','0','0.00','0','0','0','0'); -- id=1555
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 1555;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1356, '2026-10-12', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (2, '2026-10-12', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '4', storedetaildate = '2026-10-12 14:10:24' WHERE storedetailid = '1413';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '2', '4', '1', '437', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29', '25', '4', '2026-10-12 14:10:24','0','0'); -- id=4777
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 495;
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','01551', '437', '112', '1551', '12', '380', '4560', '0', '', '0', '2026-10-12 14:10:24', '1551', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','495-12,','1','1','0','0','380','4560','0','','0','0.00','0','0','0','0'); -- id=1556
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 = 1556;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1551, '2026-10-12', 4560, 3840, 3840
                    , 3840, 3840, 3840, 3840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3840, 3840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4560, sellCostBuyPrice =sellCostBuyPrice+3840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (2, '2026-10-12', 4560, 3840, 3840
                    , 3840, 3840, 3840, 3840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3840, 3840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4560, sellCostBuyPrice =sellCostBuyPrice+3840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '420', userid = '4', storedetaildate = '2026-10-12 14:10:24' WHERE storedetailid = '2563';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1551', '2', '12', '1', '437', 'اضافة فاتورة مبيعات', 'sellbillController.php', '432', '420', '4', '2026-10-12 14:10:24','0','0'); -- id=4778
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '523780',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('503500','20280', '0', '3', 'اضافة فاتورة مبيعات', '437', '523780', '2026-10-12 14:10:24', '4',  'sellbillController.php','1','','0'); -- id=542
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20280', '20280', '2026-10-12', '4', '0', '0', '2026-10-12 14:10:24','اضافة فاتورة مبيعات رقم 437','1','0',null,'0','437','sellbillController.php?do=showDetail&sellbillid=437'); -- id=2122
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2122', '501', '20280', '','0'); -- id=2165
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '523780', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2122', '143', '20280', '','0'); -- id=2124
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4376595', 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 ( '18400', '18400', '2026-10-12', '4', '0', '0', '2026-10-12 14:10:24','اضافة فاتورة مبيعات رقم 437 - صرف البضاعة من المخزن','1','0',null,'0','437','sellbillController.php?do=showDetail&sellbillid=437'); -- id=2123
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2123', '402', '18400', '','0'); -- id=2166
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4087170.23', 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 ('2123', '492', '18400', '','0'); -- id=2125
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1126455', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='2122,0,2123' where sellbillid=437;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 20280, 18400, 18400
                    , 18242.68, 18400, 18242.68, 18227.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18400, 18242.68, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+20280, sellCostBuyPrice =sellCostBuyPrice+18400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18242.68
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18242.68
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18227.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18242.68
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 20280, 18400, 18400
                    , 18242.68, 18400, 18242.68, 18227.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18400, 18242.68, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+20280, sellCostBuyPrice =sellCostBuyPrice+18400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18242.68
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+18400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+18242.68
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+18227.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18242.68
                        , returnSellVal = returnSellVal+0, 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, 20280, 18400, 18400
                    , 18242.68, 18400, 18242.68, 18227.2, 18400, 18242.68)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+20280, netSellCostBuyPrice = netSellCostBuyPrice+18400
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+18400
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+18242.68
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+18400
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+18242.68
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+18227.2
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+18400
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+18242.68;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accb3122df4d and sellbillId = 437 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:40:24";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:10:24", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:10:24', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7708
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:43:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:13:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:13:33', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7709
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:47:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:17:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:17:20', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7710
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:47:24";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:17:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:17:24', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7711
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:47:39";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:17:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:17:39', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7712
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:47:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:17:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:17:53', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7713
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:49:48";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:19:48", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 14:19:48', '4', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7714
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:50:21";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:20:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:20:21', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7715
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:53:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:23:38", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:23:38', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7716
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:57:21";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:27:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:27:21', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7717
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:57:25";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:27:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:27:25', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7718
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:57:34";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:27:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:27:34', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7719

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accbe7e35397
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 14:27:34', '06accbe7e35397', '1', '0.00', '0', '0', '1', '2700.00', '2700', '2700', '0', '1', '2026-10-12 14:27:34', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '9' ,'0','','','','','-1','0','0','0','0','0','2700','0','','0','0','2700','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=438
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','اضافة فاتورة مبيعات','438', '0', '2026-10-12 14:27:34', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2700', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 14:27:34','0','0','',''); -- id=570
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 234;
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 ('270','01455', '438', '94', '1455', '9', '300', '2700', '0', '', '0', '2026-10-12 14:27:35', '1455', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','234-9,','1','1','0','0','300','2700','0','','0','0.00','0','0','0','0'); -- id=1557
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 1557;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1455, '2026-10-12', 2700, 2430, 2430
                    , 2430, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2430, 2430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2700, 2430, 2430
                    , 2430, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2430, 2430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-12 14:27:35' WHERE storedetailid = '1480';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1455', '1', '9', '1', '438', 'اضافة فاتورة مبيعات', 'sellbillController.php', '57', '48', '2', '2026-10-12 14:27:35','0','0'); -- id=4779
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2527335',  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 ('2524635','2700', '0', '2', 'اضافة فاتورة مبيعات', '438', '2527335', '2026-10-12 14:27:35', '2',  'sellbillController.php','1','','0'); -- id=543
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2700', '2700', '2026-10-12', '2', '0', '0', '2026-10-12 14:27:35','اضافة فاتورة مبيعات رقم 438','1','0',null,'0','438','sellbillController.php?do=showDetail&sellbillid=438'); -- id=2124
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2124', '419', '2700', '','0'); -- id=2167
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2527335', 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 ('2124', '143', '2700', '','0'); -- id=2126
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4379295', 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 ( '2430', '2430', '2026-10-12', '2', '0', '0', '2026-10-12 14:27:35','اضافة فاتورة مبيعات رقم 438 - صرف البضاعة من المخزن','1','0',null,'0','438','sellbillController.php?do=showDetail&sellbillid=438'); -- id=2125
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2125', '402', '2430', '','0'); -- id=2168
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4089600.23', 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 ('2125', '382', '2430', '','0'); -- id=2127
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20087925.47', 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='2124,0,2125' where sellbillid=438;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2700, 2430, 2430
                    , 2430, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2430, 2430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2430
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2700, 2430, 2430
                    , 2430, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2430, 2430, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2430
                        , returnSellVal = returnSellVal+0, 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, 2700, 2430, 2430
                    , 2430, 2430, 2430, 2430, 2430, 2430)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2700, netSellCostBuyPrice = netSellCostBuyPrice+2430
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2430
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2430
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2430
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2430
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2430
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2430
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2430;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accbe7e35397 and sellbillId = 438 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:57:35";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:27:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:27:35', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7720
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 10:57:35";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:27:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:27:35', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7721
UPDATE product SET productName = 'جاكيت تمبو 700', productDescription = '', productCatId = '108', productBuyPrice = '675.00', productSellAllPrice = '700.00', productSellUnitPrice = '700.00', productSellHalfPrice = '700.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01491',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '675.00',lastbuyprice_withDiscount = '675',meanbuyprice = '675.00',meanbuyprice_withDiscount = '675' , productbuypricereal = '675.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.70' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='675',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='675',meanbuyprice_withTax='675',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='675',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1491';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1491, 1,'2026-10-12 14:29:15',1)
                ON DUPLICATE KEY UPDATE productid = 1491, edited = 1, sysdate = '2026-10-12 14:29:15', userid = 1; -- id=2285
UPDATE product SET productName = 'جاكت تمبو 450', productDescription = '', productCatId = '108', productBuyPrice = '430.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01497',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430.00',lastbuyprice_withDiscount = '430',meanbuyprice = '430.00',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 = '1497';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1497, 1,'2026-10-12 14:32:36',1)
                ON DUPLICATE KEY UPDATE productid = 1497, edited = 1, sysdate = '2026-10-12 14:32:36', userid = 1; -- id=2291
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:02:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:32:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:32:41', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7722
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:03:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:33:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:33:26', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7723
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:04:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:34:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:34:41', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7724
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:06:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:36:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:36:15', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7725
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:06:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:36:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:36:18', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7726
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:06:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:36:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:36:22', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7727
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:07:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:37:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 14:37:17', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7728
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:07:24";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:37:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 14:37:24', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7729
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:07:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:37:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-12 14:37:28', '1', 'details', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=details&id=12'); -- id=7730
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:07:34";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:37:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:37:34', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=7731
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 ('جاكيت تمبو 625','','108','600','625','625','625','2026-10-12','0','1','0','','0','0','0','0','0','600','600','600','600','600','0','4.17','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','0','0','0','0','0','-1','0','','600','0','0','0','0','0','0','','','0','0','0','0'); -- id=1861
UPDATE product SET productName = 'جاكيت تمبو 625', productDescription = '', productCatId = '108', productBuyPrice = '600', productSellAllPrice = '625', productSellUnitPrice = '625', productSellHalfPrice = '625', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01861',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 = '4.17' , 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='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 = '1861';
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', '1861', '1.00', '2026-10-12', '1', '0','0186101','625','625','625','600','','0','0','0','0','0','0','0','0','0','0'); -- id=1861
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1861', '1', '0', '1', '2026-10-12'); -- id=2878
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1861', '1', '0', '0', '1861', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4780
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1861, 1,'2026-10-12 14:37:34',1)
                ON DUPLICATE KEY UPDATE productid = 1861, edited = 1, sysdate = '2026-10-12 14:37:34', userid = 1; -- id=2785
UPDATE product SET productName = 'جاكيت تمبو 625', productDescription = '', productCatId = '108', productBuyPrice = '600.00', productSellAllPrice = '625.00', productSellUnitPrice = '625.00', productSellHalfPrice = '625.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01861',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 = '4.17' , 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='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 = '1861';
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 ('جاكيت تمبو 600','','108','580','600','600','600','2026-10-12','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=1862
UPDATE product SET productName = 'جاكيت تمبو 600', productDescription = '', productCatId = '108', productBuyPrice = '580', productSellAllPrice = '600', productSellUnitPrice = '600', productSellHalfPrice = '600', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01862',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 = '1862';
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', '1862', '1.00', '2026-10-12', '1', '0','0186201','600','600','600','580','','0','0','0','0','0','0','0','0','0','0'); -- id=1862
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1862', '1', '0', '1', '2026-10-12'); -- id=2879
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1862', '1', '0', '0', '1862', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4781
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1862, 1,'2026-10-12 14:37:34',1)
                ON DUPLICATE KEY UPDATE productid = 1862, edited = 1, sysdate = '2026-10-12 14:37:34', userid = 1; -- id=2786
UPDATE product SET productName = 'جاكيت تمبو 600', productDescription = '', productCatId = '108', productBuyPrice = '580.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01862',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 = '1862';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:07:35";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:37:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:37:35', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7732
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:07:50";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:37:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:37:50', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7733
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:12:39";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:12:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:42:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 14:42:41', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7734
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:12:41";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 14:42:41', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7735
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:12:48";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:42:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:42:48', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7736
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:13:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:43:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:43:02', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7737
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:13:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:43:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:43:15', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7738
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:13:21";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:43:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 14:43:21', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7739
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:13:21";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 14:43:21', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7740
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:14:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:44:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:44:03', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7741

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accc42741b15
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 14:44:03', '06accc42741b15', '1', '0.00', '0', '0', '1', '1800.00', '1800', '1800', '0', '1', '2026-10-12 14:44:03', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','1800','0','','0','0','1800','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=439
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','اضافة فاتورة مبيعات','439', '0', '2026-10-12 14:44:03', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1800', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 14:44:03','0','0','',''); -- id=571
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 71;
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 ('270','01379', '439', '94', '1379', '6', '300', '1800', '0', '', '0', '2026-10-12 14:44:03', '1379', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','71-6,','1','1','0','0','300','1800','0','','0','0.00','0','0','0','0'); -- id=1558
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 1558;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1379, '2026-10-12', 1800, 1620, 1620
                    , 1620, 1620, 1620, 1620
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1620, 1620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1800, 1620, 1620
                    , 1620, 1620, 1620, 1620
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1620, 1620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '555', userid = '2', storedetaildate = '2026-10-12 14:44:03' WHERE storedetailid = '1379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1379', '1', '6', '1', '439', 'اضافة فاتورة مبيعات', 'sellbillController.php', '561', '555', '2', '2026-10-12 14:44:03','0','0'); -- id=4782
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2529135',  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 ('2527335','1800', '0', '2', 'اضافة فاتورة مبيعات', '439', '2529135', '2026-10-12 14:44:03', '2',  'sellbillController.php','1','','0'); -- id=544
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1800', '1800', '2026-10-12', '2', '0', '0', '2026-10-12 14:44:03','اضافة فاتورة مبيعات رقم 439','1','0',null,'0','439','sellbillController.php?do=showDetail&sellbillid=439'); -- id=2126
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2126', '419', '1800', '','0'); -- id=2169
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2529135', 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 ('2126', '143', '1800', '','0'); -- id=2128
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4381095', 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 ( '1620', '1620', '2026-10-12', '2', '0', '0', '2026-10-12 14:44:03','اضافة فاتورة مبيعات رقم 439 - صرف البضاعة من المخزن','1','0',null,'0','439','sellbillController.php?do=showDetail&sellbillid=439'); -- id=2127
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2127', '402', '1620', '','0'); -- id=2170
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4091220.23', 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 ('2127', '382', '1620', '','0'); -- id=2129
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20086305.47', 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='2126,0,2127' where sellbillid=439;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 1800, 1620, 1620
                    , 1620, 1620, 1620, 1620
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1620, 1620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 1800, 1620, 1620
                    , 1620, 1620, 1620, 1620
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1620, 1620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1620
                        , returnSellVal = returnSellVal+0, 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, 1800, 1620, 1620
                    , 1620, 1620, 1620, 1620, 1620, 1620)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1800, netSellCostBuyPrice = netSellCostBuyPrice+1620
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1620
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1620
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1620
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1620
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1620
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1620
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1620;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accc42741b15 and sellbillId = 439 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:14:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:44:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:44:03', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7742
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:14:57";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:44:57", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:44:57', '2', 'showDetail', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=439'); -- id=7743
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:15:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:45:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:45:00', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7744
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:20:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:50:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:50:02', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7745
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:20:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:50:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:50:12', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7746
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:20:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:50:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 14:50:28', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7747
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:20:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:50:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 14:50:31', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7748
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:20:31";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 14:50:31', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7749
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:27:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:57:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:57:03', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7750

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accc83c579ff
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 14:57:03', '06accc83c579ff', '1', '0.00', '0', '0', '1', '3870.00', '3870', '3870', '0', '1', '2026-10-12 14:57:03', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '9' ,'0','','','','','-1','0','0','0','0','0','3870','0','','0','0','3870','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=440
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','اضافة فاتورة مبيعات','440', '0', '2026-10-12 14:57:03', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3870', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 14:57:03','0','0','',''); -- id=572
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 332;
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 ('410','01462', '440', '103', '1462', '9', '430', '3870', '0', '', '0', '2026-10-12 14:57:03', '1462', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','332-9,','1','1','0','0','430','3870','0','','0','0.00','0','0','0','0'); -- id=1559
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 1559;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1462, '2026-10-12', 3870, 3690, 3690
                    , 3690, 3690, 3690, 3690
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3690, 3690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3870, sellCostBuyPrice =sellCostBuyPrice+3690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3690
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3690
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3690
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 3870, 3690, 3690
                    , 3690, 3690, 3690, 3690
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3690, 3690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3870, sellCostBuyPrice =sellCostBuyPrice+3690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3690
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3690
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3690
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '156', userid = '2', storedetaildate = '2026-10-12 14:57:03' WHERE storedetailid = '1487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1462', '1', '9', '1', '440', 'اضافة فاتورة مبيعات', 'sellbillController.php', '165', '156', '2', '2026-10-12 14:57:03','0','0'); -- id=4783
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2533005',  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 ('2529135','3870', '0', '2', 'اضافة فاتورة مبيعات', '440', '2533005', '2026-10-12 14:57:03', '2',  'sellbillController.php','1','','0'); -- id=545
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3870', '3870', '2026-10-12', '2', '0', '0', '2026-10-12 14:57:03','اضافة فاتورة مبيعات رقم 440','1','0',null,'0','440','sellbillController.php?do=showDetail&sellbillid=440'); -- id=2128
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2128', '419', '3870', '','0'); -- id=2171
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2533005', 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 ('2128', '143', '3870', '','0'); -- id=2130
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4384965', 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 ( '3690', '3690', '2026-10-12', '2', '0', '0', '2026-10-12 14:57:03','اضافة فاتورة مبيعات رقم 440 - صرف البضاعة من المخزن','1','0',null,'0','440','sellbillController.php?do=showDetail&sellbillid=440'); -- id=2129
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2129', '402', '3690', '','0'); -- id=2172
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4094910.23', 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 ('2129', '382', '3690', '','0'); -- id=2131
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20082615.47', 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='2128,0,2129' where sellbillid=440;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 3870, 3690, 3690
                    , 3690, 3690, 3690, 3690
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3690, 3690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3870, sellCostBuyPrice =sellCostBuyPrice+3690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3690
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3690
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3690
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 3870, 3690, 3690
                    , 3690, 3690, 3690, 3690
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3690, 3690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3870, sellCostBuyPrice =sellCostBuyPrice+3690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3690
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3690
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3690
                        , returnSellVal = returnSellVal+0, 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, 3870, 3690, 3690
                    , 3690, 3690, 3690, 3690, 3690, 3690)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3870, netSellCostBuyPrice = netSellCostBuyPrice+3690
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3690
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3690
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3690
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3690
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3690
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3690
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3690;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accc83c579ff and sellbillId = 440 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:27:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:57:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 14:57:03', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7751
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:27:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:57:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 14:57:18', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7752
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:28:27";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:28:29";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:58:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 14:58:29', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7753
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:28:29";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 14:58:29', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7754
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:28:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 14:58:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 14:58:33', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7755
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:32:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:02:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:02:38', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7756

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acccb0f65096
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 15:02:38', '06acccb0f65096', '1', '0.00', '0', '10', '1', '17510.00', '17500', '17500', '0', '1', '2026-10-12 15:02:38', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '40' ,'0','','','','','-1','0','0','0','0','0','17500','0','','0','0','17500','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=441
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','اضافة فاتورة مبيعات','441', '0', '2026-10-12 15:02:38', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '17500', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 15:02:38','0','0','',''); -- id=573
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 154;
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 ('419.99','01404', '441', '99', '1404', '8', '420', '3360', '0', '', '0', '2026-10-12 15:02:38', '1404', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','154-8,','1','1','0','0','420','3360','0','','0','0.00','0','0','0','0'); -- id=1560
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 419.99, meanbuyprice_withDiscount = 419.99
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 419.99
                where sellbilldetailid = 1560;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1404, '2026-10-12', 3358.0810965163, 3360, 3360
                    , 3360, 3359.92, 3359.92, 3359.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 3360, 3360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3358.0810965163, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3359.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3359.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3359.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3358.0810965163, 3360, 3360
                    , 3360, 3359.92, 3359.92, 3359.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3360, 3360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3358.0810965163, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3359.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3359.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3359.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '520', userid = '2', storedetaildate = '2026-10-12 15:02:38' WHERE storedetailid = '1417';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1404', '1', '8', '1', '441', 'اضافة فاتورة مبيعات', 'sellbillController.php', '528', '520', '2', '2026-10-12 15:02:38','0','0'); -- id=4784
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 355;
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 ('276','01467', '441', '104', '1467', '8', '340', '2720', '0', '', '0', '2026-10-12 15:02:38', '1467', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','355-8,','1','1','0','0','340','2720','0','','0','0.00','0','0','0','0'); -- id=1561
UPDATE sellbilldetail SET  lastbuyprice = 276.00 , meanbuyprice = 276.00, lastbuyprice_withDiscount = 276.00, meanbuyprice_withDiscount = 276.00
        , lastbuyprice_withTax = 276, meanbuyprice_withTax = 276, lastbuyprice_withDiscountAndTax = 276
                where sellbilldetailid = 1561;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1467, '2026-10-12', 2718.4466019417, 2208, 2208
                    , 2208, 2208, 2208, 2208
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2208, 2208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2718.4466019417, sellCostBuyPrice =sellCostBuyPrice+2208
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2208, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2208
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2208, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2208
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2208
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2208
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2718.4466019417, 2208, 2208
                    , 2208, 2208, 2208, 2208
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2208, 2208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2718.4466019417, sellCostBuyPrice =sellCostBuyPrice+2208
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2208, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2208
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2208, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2208
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2208
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2208
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '588', userid = '2', storedetaildate = '2026-10-12 15:02:38' WHERE storedetailid = '1492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '8', '1', '441', 'اضافة فاتورة مبيعات', 'sellbillController.php', '596', '588', '2', '2026-10-12 15:02:38','0','0'); -- id=4785
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 529;
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 ('432.4','01627', '441', '120', '1627', '9', '470', '4230', '0', '', '0', '2026-10-12 15:02:38', '1627', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','529-9,','1','1','0','0','470','4230','0','','0','0.00','0','0','0','0'); -- id=1562
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 432.40, meanbuyprice_withDiscount = 432.40
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 432.4
                where sellbilldetailid = 1562;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1627, '2026-10-12', 4227.5842375785, 4230, 4230
                    , 4230, 3891.6, 3891.6, 3891.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4230, 4230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4227.5842375785, sellCostBuyPrice =sellCostBuyPrice+4230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3891.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3891.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3891.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 4227.5842375785, 4230, 4230
                    , 4230, 3891.6, 3891.6, 3891.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4230, 4230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4227.5842375785, sellCostBuyPrice =sellCostBuyPrice+4230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3891.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3891.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3891.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 15:02:38' WHERE storedetailid = '1652';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1627', '1', '9', '1', '441', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '15', '2', '2026-10-12 15:02:38','0','0'); -- id=4786
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 553;
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 ('441.6','01689', '441', '126', '1689', '3', '480', '1440', '0', '', '0', '2026-10-12 15:02:38', '1689', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','553-3,','1','1','0','0','480','1440','0','','0','0.00','0','0','0','0'); -- id=1563
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 480.00, lastbuyprice_withDiscount = 441.60, meanbuyprice_withDiscount = 441.60
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 480, lastbuyprice_withDiscountAndTax = 441.6
                where sellbilldetailid = 1563;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1689, '2026-10-12', 1439.1776127927, 1440, 1440
                    , 1440, 1324.8, 1324.8, 1324.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1440, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1439.1776127927, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1324.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1324.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1324.8
                            , 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+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-10-12', 1439.1776127927, 1440, 1440
                    , 1440, 1324.8, 1324.8, 1324.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1440, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1439.1776127927, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1324.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1324.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1324.8
                            , 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-10-12 15:02:38' WHERE storedetailid = '2701';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1689', '1', '3', '1', '441', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '15', '2', '2026-10-12 15:02:38','0','0'); -- id=4787
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 643;
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 ('496.8','01730', '441', '132', '1730', '6', '540', '3240', '0', '', '0', '2026-10-12 15:02:39', '1730', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','643-6,','1','1','0','0','540','3240','0','','0','0.00','0','0','0','0'); -- id=1564
UPDATE sellbilldetail SET  lastbuyprice = 540.00 , meanbuyprice = 540.00, lastbuyprice_withDiscount = 496.80, meanbuyprice_withDiscount = 496.80
        , lastbuyprice_withTax = 540, meanbuyprice_withTax = 540, lastbuyprice_withDiscountAndTax = 496.8
                where sellbilldetailid = 1564;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1730, '2026-10-12', 3238.1496287836, 3240, 3240
                    , 3240, 2980.8, 2980.8, 2980.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3240, 3240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3238.1496287836, sellCostBuyPrice =sellCostBuyPrice+3240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2980.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2980.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2980.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3238.1496287836, 3240, 3240
                    , 3240, 2980.8, 2980.8, 2980.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3240, 3240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3238.1496287836, sellCostBuyPrice =sellCostBuyPrice+3240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2980.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2980.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2980.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 15:02:39' WHERE storedetailid = '2743';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1730', '1', '6', '1', '441', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '18', '2', '2026-10-12 15:02:39','0','0'); -- id=4788
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 559;
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 ('386.4','01695', '441', '127', '1695', '6', '420', '2520', '0', '', '0', '2026-10-12 15:02:39', '1695', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','559-6,','1','1','0','0','420','2520','0','','0','0.00','0','0','0','0'); -- id=1565
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 386.40, meanbuyprice_withDiscount = 386.40
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 386.4
                where sellbilldetailid = 1565;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1695, '2026-10-12', 2518.5608223872, 2520, 2520
                    , 2520, 2318.4, 2318.4, 2318.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2520, 2520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2518.5608223872, sellCostBuyPrice =sellCostBuyPrice+2520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2318.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2318.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2318.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2518.5608223872, 2520, 2520
                    , 2520, 2318.4, 2318.4, 2318.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2520, 2520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2518.5608223872, sellCostBuyPrice =sellCostBuyPrice+2520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2318.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2318.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2318.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '96', userid = '2', storedetaildate = '2026-10-12 15:02:39' WHERE storedetailid = '2707';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1695', '1', '6', '1', '441', 'اضافة فاتورة مبيعات', 'sellbillController.php', '102', '96', '2', '2026-10-12 15:02:39','0','0'); -- id=4789
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2550505',  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 ('2533005','17500', '0', '2', 'اضافة فاتورة مبيعات', '441', '2550505', '2026-10-12 15:02:39', '2',  'sellbillController.php','1','','0'); -- id=546
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '17510', '17510', '2026-10-12', '2', '0', '0', '2026-10-12 15:02:39','اضافة فاتورة مبيعات رقم 441','1','0',null,'0','441','sellbillController.php?do=showDetail&sellbillid=441'); -- id=2130
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2130', '419', '17500', '','0'); -- id=2173
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2550505', 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 ('2130', '398', '10', '','0'); -- id=2174
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '464685', theOrder = '0', layingOrder = '51', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-08-08 17:58:26' WHERE id = '398';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2130', '143', '17510', '','0'); -- id=2132
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4402475', 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 ( '16083.52', '16083.52', '2026-10-12', '2', '0', '0', '2026-10-12 15:02:39','اضافة فاتورة مبيعات رقم 441 - صرف البضاعة من المخزن','1','0',null,'0','441','sellbillController.php?do=showDetail&sellbillid=441'); -- id=2131
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2131', '402', '16083.52', '','0'); -- id=2175
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4110993.75', 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 ('2131', '382', '16083.52', '','0'); -- id=2133
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20066531.95', 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='2130,0,2131' where sellbillid=441;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 17500, 16998, 16998
                    , 16998, 16083.52, 16083.52, 16083.52
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,16998, 16998, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17500, sellCostBuyPrice =sellCostBuyPrice+16998
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+16998, sellCostMeanBuyPrice = sellCostMeanBuyPrice+16998
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+16083.52, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+16083.52
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+16083.52
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+16998
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+16998
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 17500, 16998, 16998
                    , 16998, 16083.52, 16083.52, 16083.52
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,16998, 16998, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17500, sellCostBuyPrice =sellCostBuyPrice+16998
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+16998, sellCostMeanBuyPrice = sellCostMeanBuyPrice+16998
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+16083.52, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+16083.52
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+16083.52
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+16998
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+16998
                        , returnSellVal = returnSellVal+0, 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, 17500, 16998, 16998
                    , 16998, 16083.52, 16083.52, 16083.52, 16998, 16998)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+17500, netSellCostBuyPrice = netSellCostBuyPrice+16998
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+16998
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+16998
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+16083.52
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+16083.52
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+16083.52
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+16998
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+16998;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acccb0f65096 and sellbillId = 441 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:32:39";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:02:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:02:39', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7757
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:36:26";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-12 15:06:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 15:06:26', '1', '', '197.193.5.8', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7758
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:36:26";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 15:06:26', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7759
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:36:35";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-12 15:06:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:06:35', '1', 'addsellBill', '197.193.5.8', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7760
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:36:39";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-12 15:06:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:06:39', '1', 'show', '197.193.5.8', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=7761
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:36:48";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-12 15:06:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:06:48', '1', 'show', '197.193.5.8', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=7762
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:36:55";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-12 15:06:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:06:55', '1', 'show', '197.193.5.8', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=7763
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:37:19";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-12 15:07:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-10-12 15:07:19', '1', '', '197.193.5.8', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellBillReportsController.php'); -- id=7764
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:37:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:07:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 15:07:53', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7765
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:38:24";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-12 15:08:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreportbills.php', '2026-10-12 15:08:24', '1', 'showbills', '197.193.5.8', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreportbills.php?do=showbills'); -- id=7766
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:39:02";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-12 15:09:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 15:09:02', '1', '', '197.193.5.8', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7767
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:39:12";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-12 15:09:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:09:12', '1', 'showDetail', '197.193.5.8', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=408'); -- id=7768
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:39:33";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-12 15:09:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:09:33', '1', 'showDetail', '197.193.5.8', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=409'); -- id=7769
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:39:39";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-12 15:09:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:09:39', '1', 'showDetail', '197.193.5.8', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=411'); -- id=7770
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:40:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:10:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 15:10:03', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7771
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:40:05";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:10:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 15:10:05', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7772
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:40:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:10:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 15:10:06', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7773
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:40:06";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 15:10:06', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7774
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:41:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:11:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 15:11:58', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7775
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:42:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:12:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 15:12:49', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=7776
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:43:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:13:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 15:13:12', '1', 'add2', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=7777
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-10-12','','93', '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=146
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (146, 1,'2026-10-12 15:13:12',1)
                ON DUPLICATE KEY UPDATE catid = 146, edited = 1, sysdate = '2026-10-12 15:13:12', userid = 1; -- id=158
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:43:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:13:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 15:13:13', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=7778
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:43:14";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:13:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 15:13:14', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7779
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:46:57";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:16:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 15:16:57', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7780
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:47:05";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:17:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 15:17:05', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7781
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:48:39";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:18:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-12 15:18:39', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php'); -- id=7782
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:52:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:22:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 15:22:26', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=7783
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 ('موديل150 تاي بوكس','','146','440','440','440','440','2026-10-12','0','1','0','','0','0','0','0','0','440','440','440','440','440','0','0','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','0','0','0','0','0','-1','0','','440','0','0','0','0','0','0','','','0','0','0','0'); -- id=1863
UPDATE product SET productName = 'موديل150 تاي بوكس', productDescription = '', productCatId = '146', productBuyPrice = '440', productSellAllPrice = '440', productSellUnitPrice = '440', productSellHalfPrice = '440', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01863',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 = '0' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '1863';
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', '1863', '1', '2026-10-12', '1', '0','0186301','440','440','440','440','','0','0','0','0','0','0','0','0','0','0'); -- id=1863
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1863', '1', '0', '1', '2026-10-12'); -- id=2880
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1863', '1', '0', '0', '1863', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4790
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1863, 1,'2026-10-12 15:22:26',1)
                ON DUPLICATE KEY UPDATE productid = 1863, edited = 1, sysdate = '2026-10-12 15:22:26', userid = 1; -- id=2787
UPDATE product SET productName = 'موديل150 تاي بوكس', productDescription = '', productCatId = '146', productBuyPrice = '440.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01863',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 = '0' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '1863';
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 ('موديل 151 تاي بوكس','','146','490','490','490','490','2026-10-12','0','1','0','','0','0','0','0','0','490','490','490','490','490','0','0','0','0','.','0','0','0','490','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','490','490','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','490','0','0','0','0','0','0','','','0','0','0','0'); -- id=1864
UPDATE product SET productName = 'موديل 151 تاي بوكس', productDescription = '', productCatId = '146', productBuyPrice = '490', productSellAllPrice = '490', productSellUnitPrice = '490', productSellHalfPrice = '490', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01864',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '490',meanbuyprice = '490',meanbuyprice_withDiscount = '490' , productbuypricereal = '490' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',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='490',meanbuyprice_withTax='490',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='490',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1864';
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', '1864', '1', '2026-10-12', '1', '0','0186401','490','490','490','490','','0','0','0','0','0','0','0','0','0','0'); -- id=1864
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1864', '1', '0', '1', '2026-10-12'); -- id=2881
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1864', '1', '0', '0', '1864', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4791
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1864, 1,'2026-10-12 15:22:26',1)
                ON DUPLICATE KEY UPDATE productid = 1864, edited = 1, sysdate = '2026-10-12 15:22:26', userid = 1; -- id=2788
UPDATE product SET productName = 'موديل 151 تاي بوكس', productDescription = '', productCatId = '146', productBuyPrice = '490.00', productSellAllPrice = '490.00', productSellUnitPrice = '490.00', productSellHalfPrice = '490.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01864',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '490',meanbuyprice = '490',meanbuyprice_withDiscount = '490' , productbuypricereal = '490' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',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='490',meanbuyprice_withTax='490',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='490',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1864';
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 ('موديل 152 تاي بوكس ','','146','510','510','510','510','2026-10-12','0','1','0','','0','0','0','0','0','510','510','510','510','510','0','0','0','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=1865
UPDATE product SET productName = 'موديل 152 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '510', productSellAllPrice = '510', productSellUnitPrice = '510', productSellHalfPrice = '510', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01865',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 = '0' , buyhalf_precentage = '0' , 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 = '1865';
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', '1865', '1', '2026-10-12', '1', '0','0186501','510','510','510','510','','0','0','0','0','0','0','0','0','0','0'); -- id=1865
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1865', '1', '0', '1', '2026-10-12'); -- id=2882
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1865', '1', '0', '0', '1865', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4792
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1865, 1,'2026-10-12 15:22:26',1)
                ON DUPLICATE KEY UPDATE productid = 1865, edited = 1, sysdate = '2026-10-12 15:22:26', userid = 1; -- id=2789
UPDATE product SET productName = 'موديل 152 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '510.00', productSellAllPrice = '510.00', productSellUnitPrice = '510.00', productSellHalfPrice = '510.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01865',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 = '0' , buyhalf_precentage = '0' , 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 = '1865';
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 ('موديل 153 تاي بوكس ','','146','390','390','390','390','2026-10-12','0','1','0','','0','0','0','0','0','390','390','390','390','390','0','0','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=1866
UPDATE product SET productName = 'موديل 153 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '390', productSellAllPrice = '390', productSellUnitPrice = '390', productSellHalfPrice = '390', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01866',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 = '0' , 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 = '1866';
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', '1866', '1', '2026-10-12', '1', '0','0186601','390','390','390','390','','0','0','0','0','0','0','0','0','0','0'); -- id=1866
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1866', '1', '0', '1', '2026-10-12'); -- id=2883
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1866', '1', '0', '0', '1866', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4793
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1866, 1,'2026-10-12 15:22:26',1)
                ON DUPLICATE KEY UPDATE productid = 1866, edited = 1, sysdate = '2026-10-12 15:22:26', userid = 1; -- id=2790
UPDATE product SET productName = 'موديل 153 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '390.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01866',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 = '0' , 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 = '1866';
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 ('موديل 154 تاي بوكس ','','146','570','570','570','570','2026-10-12','0','1','0','','0','0','0','0','0','570','570','570','570','570','0','0','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=1867
UPDATE product SET productName = 'موديل 154 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '570', productSellAllPrice = '570', productSellUnitPrice = '570', productSellHalfPrice = '570', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01867',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 = '0' , 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 = '1867';
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', '1867', '1', '2026-10-12', '1', '0','0186701','570','570','570','570','','0','0','0','0','0','0','0','0','0','0'); -- id=1867
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1867', '1', '0', '1', '2026-10-12'); -- id=2884
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1867', '1', '0', '0', '1867', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4794
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1867, 1,'2026-10-12 15:22:26',1)
                ON DUPLICATE KEY UPDATE productid = 1867, edited = 1, sysdate = '2026-10-12 15:22:26', userid = 1; -- id=2791
UPDATE product SET productName = 'موديل 154 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '570.00', productSellAllPrice = '570.00', productSellUnitPrice = '570.00', productSellHalfPrice = '570.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01867',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 = '0' , 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 = '1867';
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 ('موديل 156 تاي بوكس ','','146','830','830','830','830','2026-10-12','0','1','0','','0','0','0','0','0','830','830','830','830','830','0','0','0','0','.','0','0','0','830','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','830','830','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','830','0','0','0','0','0','0','','','0','0','0','0'); -- id=1868
UPDATE product SET productName = 'موديل 156 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '830', productSellAllPrice = '830', productSellUnitPrice = '830', productSellHalfPrice = '830', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01868',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '830',lastbuyprice_withDiscount = '830',meanbuyprice = '830',meanbuyprice_withDiscount = '830' , productbuypricereal = '830' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='830',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='830',meanbuyprice_withTax='830',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='830',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1868';
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', '1868', '1', '2026-10-12', '1', '0','0186801','830','830','830','830','','0','0','0','0','0','0','0','0','0','0'); -- id=1868
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1868', '1', '0', '1', '2026-10-12'); -- id=2885
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1868', '1', '0', '0', '1868', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4795
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1868, 1,'2026-10-12 15:22:26',1)
                ON DUPLICATE KEY UPDATE productid = 1868, edited = 1, sysdate = '2026-10-12 15:22:26', userid = 1; -- id=2792
UPDATE product SET productName = 'موديل 156 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '830.00', productSellAllPrice = '830.00', productSellUnitPrice = '830.00', productSellHalfPrice = '830.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01868',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '830',lastbuyprice_withDiscount = '830',meanbuyprice = '830',meanbuyprice_withDiscount = '830' , productbuypricereal = '830' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='830',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='830',meanbuyprice_withTax='830',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='830',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1868';
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 ('موديل 157 تاي بوكس ','','146','370','370','370','370','2026-10-12','0','1','0','','0','0','0','0','0','370','370','370','370','370','0','0','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=1869
UPDATE product SET productName = 'موديل 157 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '370', productSellAllPrice = '370', productSellUnitPrice = '370', productSellHalfPrice = '370', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01869',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 = '0' , 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 = '1869';
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', '1869', '1', '2026-10-12', '1', '0','0186901','370','370','370','370','','0','0','0','0','0','0','0','0','0','0'); -- id=1869
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1869', '1', '0', '1', '2026-10-12'); -- id=2886
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1869', '1', '0', '0', '1869', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4796
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1869, 1,'2026-10-12 15:22:26',1)
                ON DUPLICATE KEY UPDATE productid = 1869, edited = 1, sysdate = '2026-10-12 15:22:26', userid = 1; -- id=2793
UPDATE product SET productName = 'موديل 157 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01869',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 = '0' , 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 = '1869';
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 ('موديل 158 تاي بوكس ','','146','500','500','500','500','2026-10-12','0','1','0','','0','0','0','0','0','500','500','500','500','500','0','0','0','0','.','0','0','0','500','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','500','500','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','500','0','0','0','0','0','0','','','0','0','0','0'); -- id=1870
UPDATE product SET productName = 'موديل 158 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '500', productSellAllPrice = '500', productSellUnitPrice = '500', productSellHalfPrice = '500', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01870',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',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='500',meanbuyprice_withTax='500',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='500',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1870';
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', '1870', '1', '2026-10-12', '1', '0','0187001','500','500','500','500','','0','0','0','0','0','0','0','0','0','0'); -- id=1870
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1870', '1', '0', '1', '2026-10-12'); -- id=2887
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1870', '1', '0', '0', '1870', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4797
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1870, 1,'2026-10-12 15:22:26',1)
                ON DUPLICATE KEY UPDATE productid = 1870, edited = 1, sysdate = '2026-10-12 15:22:26', userid = 1; -- id=2794
UPDATE product SET productName = 'موديل 158 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '500.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01870',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',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='500',meanbuyprice_withTax='500',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='500',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1870';
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 ('موديل 161 تاي بوكس ','','146','480','480','480','480','2026-10-12','0','1','0','','0','0','0','0','0','480','480','480','480','480','0','0','0','0','.','0','0','0','480','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','480','480','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','480','0','0','0','0','0','0','','','0','0','0','0'); -- id=1871
UPDATE product SET productName = 'موديل 161 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '480', productSellAllPrice = '480', productSellUnitPrice = '480', productSellHalfPrice = '480', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01871',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '480',meanbuyprice_withDiscount = '480' , productbuypricereal = '480' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='480',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='480',meanbuyprice_withTax='480',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='480',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1871';
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', '1871', '1', '2026-10-12', '1', '0','0187101','480','480','480','480','','0','0','0','0','0','0','0','0','0','0'); -- id=1871
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1871', '1', '0', '1', '2026-10-12'); -- id=2888
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1871', '1', '0', '0', '1871', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4798
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1871, 1,'2026-10-12 15:22:26',1)
                ON DUPLICATE KEY UPDATE productid = 1871, edited = 1, sysdate = '2026-10-12 15:22:26', userid = 1; -- id=2795
UPDATE product SET productName = 'موديل 161 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '480.00', productSellAllPrice = '480.00', productSellUnitPrice = '480.00', productSellHalfPrice = '480.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01871',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '480',meanbuyprice_withDiscount = '480' , productbuypricereal = '480' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='480',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='480',meanbuyprice_withTax='480',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='480',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1871';
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 ('موديل 162 تاي بوكس ','','146','490','490','490','490','2026-10-12','0','1','0','','0','0','0','0','0','490','490','490','490','490','0','0','0','0','.','0','0','0','490','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','490','490','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','490','0','0','0','0','0','0','','','0','0','0','0'); -- id=1872
UPDATE product SET productName = 'موديل 162 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '490', productSellAllPrice = '490', productSellUnitPrice = '490', productSellHalfPrice = '490', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01872',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '490',meanbuyprice = '490',meanbuyprice_withDiscount = '490' , productbuypricereal = '490' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',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='490',meanbuyprice_withTax='490',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='490',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1872';
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', '1872', '1', '2026-10-12', '1', '0','0187201','490','490','490','490','','0','0','0','0','0','0','0','0','0','0'); -- id=1872
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1872', '1', '0', '1', '2026-10-12'); -- id=2889
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1872', '1', '0', '0', '1872', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4799
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1872, 1,'2026-10-12 15:22:26',1)
                ON DUPLICATE KEY UPDATE productid = 1872, edited = 1, sysdate = '2026-10-12 15:22:26', userid = 1; -- id=2796
UPDATE product SET productName = 'موديل 162 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '490.00', productSellAllPrice = '490.00', productSellUnitPrice = '490.00', productSellHalfPrice = '490.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01872',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '490',meanbuyprice = '490',meanbuyprice_withDiscount = '490' , productbuypricereal = '490' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',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='490',meanbuyprice_withTax='490',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='490',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1872';
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 ('موديل 163 تاي بوكس ','','146','470','470','470','470','2026-10-12','0','1','0','','0','0','0','0','0','470','470','470','470','470','0','0','0','0','.','0','0','0','470','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','470','470','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','470','0','0','0','0','0','0','','','0','0','0','0'); -- id=1873
UPDATE product SET productName = 'موديل 163 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '470', productSellAllPrice = '470', productSellUnitPrice = '470', productSellHalfPrice = '470', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01873',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1873';
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', '1873', '1', '2026-10-12', '1', '0','0187301','470','470','470','470','','0','0','0','0','0','0','0','0','0','0'); -- id=1873
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1873', '1', '0', '1', '2026-10-12'); -- id=2890
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1873', '1', '0', '0', '1873', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4800
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1873, 1,'2026-10-12 15:22:27',1)
                ON DUPLICATE KEY UPDATE productid = 1873, edited = 1, sysdate = '2026-10-12 15:22:27', userid = 1; -- id=2797
UPDATE product SET productName = 'موديل 163 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '470.00', productSellAllPrice = '470.00', productSellUnitPrice = '470.00', productSellHalfPrice = '470.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01873',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1873';
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 ('موديل 165 تاي بوكس ','','146','520','520','520','520','2026-10-12','0','1','0','','0','0','0','0','0','520','520','520','520','520','0','0','0','0','.','0','0','0','520','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','520','520','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','520','0','0','0','0','0','0','','','0','0','0','0'); -- id=1874
UPDATE product SET productName = 'موديل 165 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '520', productSellAllPrice = '520', productSellUnitPrice = '520', productSellHalfPrice = '520', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01874',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '520',lastbuyprice_withDiscount = '520',meanbuyprice = '520',meanbuyprice_withDiscount = '520' , productbuypricereal = '520' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='520',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='520',meanbuyprice_withTax='520',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='520',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1874';
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', '1874', '1', '2026-10-12', '1', '0','0187401','520','520','520','520','','0','0','0','0','0','0','0','0','0','0'); -- id=1874
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1874', '1', '0', '1', '2026-10-12'); -- id=2891
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1874', '1', '0', '0', '1874', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4801
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1874, 1,'2026-10-12 15:22:27',1)
                ON DUPLICATE KEY UPDATE productid = 1874, edited = 1, sysdate = '2026-10-12 15:22:27', userid = 1; -- id=2798
UPDATE product SET productName = 'موديل 165 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '520.00', productSellAllPrice = '520.00', productSellUnitPrice = '520.00', productSellHalfPrice = '520.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01874',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '520',lastbuyprice_withDiscount = '520',meanbuyprice = '520',meanbuyprice_withDiscount = '520' , productbuypricereal = '520' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='520',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='520',meanbuyprice_withTax='520',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='520',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1874';
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 ('موديل 166 تاي بوكس ','','146','590','590','590','590','2026-10-12','0','1','0','','0','0','0','0','0','590','590','590','590','590','0','0','0','0','.','0','0','0','590','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','590','590','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','590','0','0','0','0','0','0','','','0','0','0','0'); -- id=1875
UPDATE product SET productName = 'موديل 166 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '590', productSellAllPrice = '590', productSellUnitPrice = '590', productSellHalfPrice = '590', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01875',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '590',lastbuyprice_withDiscount = '590',meanbuyprice = '590',meanbuyprice_withDiscount = '590' , productbuypricereal = '590' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='590',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='590',meanbuyprice_withTax='590',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='590',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1875';
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', '1875', '1', '2026-10-12', '1', '0','0187501','590','590','590','590','','0','0','0','0','0','0','0','0','0','0'); -- id=1875
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1875', '1', '0', '1', '2026-10-12'); -- id=2892
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1875', '1', '0', '0', '1875', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4802
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1875, 1,'2026-10-12 15:22:27',1)
                ON DUPLICATE KEY UPDATE productid = 1875, edited = 1, sysdate = '2026-10-12 15:22:27', userid = 1; -- id=2799
UPDATE product SET productName = 'موديل 166 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '590.00', productSellAllPrice = '590.00', productSellUnitPrice = '590.00', productSellHalfPrice = '590.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01875',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '590',lastbuyprice_withDiscount = '590',meanbuyprice = '590',meanbuyprice_withDiscount = '590' , productbuypricereal = '590' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='590',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='590',meanbuyprice_withTax='590',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='590',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1875';
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 ('موديل 167 تاي بوكس ','','146','600','600','600','600','2026-10-12','0','1','0','','0','0','0','0','0','600','600','600','600','600','0','0','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=1876
UPDATE product SET productName = 'موديل 167 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '600', productSellAllPrice = '600', productSellUnitPrice = '600', productSellHalfPrice = '600', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01876',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 = '0' , 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 = '1876';
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', '1876', '1', '2026-10-12', '1', '0','0187601','600','600','600','600','','0','0','0','0','0','0','0','0','0','0'); -- id=1876
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1876', '1', '0', '1', '2026-10-12'); -- id=2893
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1876', '1', '0', '0', '1876', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4803
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1876, 1,'2026-10-12 15:22:27',1)
                ON DUPLICATE KEY UPDATE productid = 1876, edited = 1, sysdate = '2026-10-12 15:22:27', userid = 1; -- id=2800
UPDATE product SET productName = 'موديل 167 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '600.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01876',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 = '0' , 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 = '1876';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:52:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:22:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 15:22:28', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7784
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:52:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:22:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 15:22:33', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7785
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-10-12 15:22:48', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=156
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 ('156', '0', '', '0', 'إضافة مورد جديد', '156', '', '2026-10-12 15:22:48', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=388
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-10-12 15:22:48'); -- id=639
UPDATE supplier SET suppliername = 'تاي بوكس', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-12', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='639',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '156';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:56:24";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:26:24", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:26:24', '4', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7786

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accc33ae966f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 15:26:24', '06accc33ae966f', '1', '0.00', '0', '0', '1', '1650.00', '1650', '1650', '0', '2', '2026-10-12 15:26:24', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1650','0','','0','0','1650','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=442
UPDATE client SET  clientdebt = '0', userid = '4' 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','اضافة فاتورة مبيعات','442', '0', '2026-10-12 15:26:24', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1650', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 15:26:24','0','0','',''); -- id=574
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 621;
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 ('495','01722', '442', '49', '1722', '3', '550', '1650', '0', '', '0', '2026-10-12 15:26:24', '1722', '0.00', '0', '2','0.00','','','0','0','0','0','0','0','0','0','','621-3,','1','1','0','0','550','1650','0','','0','0.00','0','0','0','0'); -- id=1566
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 495.00, meanbuyprice_withDiscount = 495.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 495
                where sellbilldetailid = 1566;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1722, '2026-10-12', 1650, 1650, 1650
                    , 1650, 1485, 1485, 1485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1485
                            , 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+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 (2, '2026-10-12', 1650, 1650, 1650
                    , 1650, 1485, 1485, 1485
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1485
                            , 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 = '30', userid = '4', storedetaildate = '2026-10-12 15:26:24' WHERE storedetailid = '2735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1722', '2', '3', '1', '442', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '30', '4', '2026-10-12 15:26:24','0','0'); -- id=4804
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '525430',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('523780','1650', '0', '3', 'اضافة فاتورة مبيعات', '442', '525430', '2026-10-12 15:26:24', '4',  'sellbillController.php','1','','0'); -- id=547
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1650', '1650', '2026-10-12', '4', '0', '0', '2026-10-12 15:26:24','اضافة فاتورة مبيعات رقم 442','1','0',null,'0','442','sellbillController.php?do=showDetail&sellbillid=442'); -- id=2132
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2132', '501', '1650', '','0'); -- id=2176
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '525430', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2132', '143', '1650', '','0'); -- id=2134
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4404125', 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 ( '1485', '1485', '2026-10-12', '4', '0', '0', '2026-10-12 15:26:24','اضافة فاتورة مبيعات رقم 442 - صرف البضاعة من المخزن','1','0',null,'0','442','sellbillController.php?do=showDetail&sellbillid=442'); -- id=2133
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2133', '402', '1485', '','0'); -- id=2177
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4112478.75', 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 ('2133', '492', '1485', '','0'); -- id=2135
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1124970', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='2132,0,2133' where sellbillid=442;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 1650, 1650, 1650
                    , 1650, 1485, 1485, 1485
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1485
                            , 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;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 1650, 1650, 1650
                    , 1650, 1485, 1485, 1485
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1650, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1485, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1485
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1485
                            , 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1650, 1650, 1650
                    , 1650, 1485, 1485, 1485, 1650, 1650)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1650, netSellCostBuyPrice = netSellCostBuyPrice+1650
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1650
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1650
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1485
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1485
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1485
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1650
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1650;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accc33ae966f and sellbillId = 442 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 11:56:24";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:26:24", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:26:24', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7787
UPDATE productunit SET unitid = '1', productid = '1863', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0186301',proUnitSellAllPrice='440',proUnitSellHalfPrice='440',proUnitSellUnitPrice ='440',proUnitBuyPrice='440',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1863';
UPDATE product SET productName = 'موديل150 تاي بوكس', productDescription = '', productCatId = '146', productBuyPrice = '420', productSellAllPrice = '440', productSellUnitPrice = '440', productSellHalfPrice = '440', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01863',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440.00',lastbuyprice_withDiscount = '440',meanbuyprice = '440.00',meanbuyprice_withDiscount = '440' , productbuypricereal = '440' , buypricereal_precentage = '0' , buytotal_precentage = '0' , 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 = '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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '1863';
UPDATE productunit SET unitid = '1', productid = '1864', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0186401',proUnitSellAllPrice='490',proUnitSellHalfPrice='490',proUnitSellUnitPrice ='490',proUnitBuyPrice='490',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1864';
UPDATE product SET productName = 'موديل 151 تاي بوكس', productDescription = '', productCatId = '146', productBuyPrice = '470', productSellAllPrice = '490', productSellUnitPrice = '490', productSellHalfPrice = '490', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01864',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490.00',lastbuyprice_withDiscount = '490',meanbuyprice = '490.00',meanbuyprice_withDiscount = '490' , productbuypricereal = '490' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='490',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='490',meanbuyprice_withTax='490',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='490',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1864';
UPDATE productunit SET unitid = '1', productid = '1866', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0186601',proUnitSellAllPrice='390',proUnitSellHalfPrice='390',proUnitSellUnitPrice ='390',proUnitBuyPrice='390',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1866';
UPDATE product SET productName = 'موديل 153 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '490', productSellAllPrice = '390', productSellUnitPrice = '390', productSellHalfPrice = '390', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01866',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390.00',lastbuyprice_withDiscount = '390',meanbuyprice = '390.00',meanbuyprice_withDiscount = '390' , productbuypricereal = '390' , buypricereal_precentage = '0' , buytotal_precentage = '0' , 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 = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1866';
UPDATE productunit SET unitid = '1', productid = '1866', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0186601',proUnitSellAllPrice='390',proUnitSellHalfPrice='390',proUnitSellUnitPrice ='390',proUnitBuyPrice='390',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1866';
UPDATE product SET productName = 'موديل 153 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '490', productSellAllPrice = '390', productSellUnitPrice = '390', productSellHalfPrice = '390', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01866',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390.00',lastbuyprice_withDiscount = '390',meanbuyprice = '390.00',meanbuyprice_withDiscount = '390' , productbuypricereal = '390' , buypricereal_precentage = '0' , buytotal_precentage = '0' , 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 = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1866';
UPDATE productunit SET unitid = '1', productid = '1866', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0186601',proUnitSellAllPrice='390',proUnitSellHalfPrice='390',proUnitSellUnitPrice ='390',proUnitBuyPrice='390',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1866';
UPDATE product SET productName = 'موديل 153 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '370', productSellAllPrice = '390', productSellUnitPrice = '390', productSellHalfPrice = '390', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01866',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390.00',lastbuyprice_withDiscount = '390',meanbuyprice = '390.00',meanbuyprice_withDiscount = '390' , productbuypricereal = '390' , buypricereal_precentage = '0' , buytotal_precentage = '0' , 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 = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1866';
UPDATE productunit SET unitid = '1', productid = '1867', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0186701',proUnitSellAllPrice='570',proUnitSellHalfPrice='570',proUnitSellUnitPrice ='570',proUnitBuyPrice='570',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1867';
UPDATE product SET productName = 'موديل 154 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '550', productSellAllPrice = '570', productSellUnitPrice = '570', productSellHalfPrice = '570', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01867',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570.00',lastbuyprice_withDiscount = '570',meanbuyprice = '570.00',meanbuyprice_withDiscount = '570' , productbuypricereal = '570' , buypricereal_precentage = '0' , buytotal_precentage = '0' , 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 = '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 = '1867';
UPDATE productunit SET unitid = '1', productid = '1868', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0186801',proUnitSellAllPrice='830',proUnitSellHalfPrice='830',proUnitSellUnitPrice ='830',proUnitBuyPrice='830',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1868';
UPDATE product SET productName = 'موديل 156 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '810', productSellAllPrice = '830', productSellUnitPrice = '830', productSellHalfPrice = '830', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01868',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '830.00',lastbuyprice_withDiscount = '830',meanbuyprice = '830.00',meanbuyprice_withDiscount = '830' , productbuypricereal = '830' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='830',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='830',meanbuyprice_withTax='830',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='830',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1868';
UPDATE productunit SET unitid = '1', productid = '1869', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0186901',proUnitSellAllPrice='370',proUnitSellHalfPrice='370',proUnitSellUnitPrice ='370',proUnitBuyPrice='370',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1869';
UPDATE product SET productName = 'موديل 157 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '350', productSellAllPrice = '370', productSellUnitPrice = '370', productSellHalfPrice = '370', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01869',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370.00',lastbuyprice_withDiscount = '370',meanbuyprice = '370.00',meanbuyprice_withDiscount = '370' , productbuypricereal = '370' , buypricereal_precentage = '0' , buytotal_precentage = '0' , 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 = '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='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 = '1869';
UPDATE productunit SET unitid = '1', productid = '1870', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0187001',proUnitSellAllPrice='500',proUnitSellHalfPrice='500',proUnitSellUnitPrice ='500',proUnitBuyPrice='500',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1870';
UPDATE product SET productName = 'موديل 158 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '480', productSellAllPrice = '500', productSellUnitPrice = '500', productSellHalfPrice = '500', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01870',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500.00',lastbuyprice_withDiscount = '500',meanbuyprice = '500.00',meanbuyprice_withDiscount = '500' , productbuypricereal = '500' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='500',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='500',meanbuyprice_withTax='500',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='500',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1870';
UPDATE productunit SET unitid = '1', productid = '1871', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0187101',proUnitSellAllPrice='480',proUnitSellHalfPrice='480',proUnitSellUnitPrice ='480',proUnitBuyPrice='480',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1871';
UPDATE product SET productName = 'موديل 161 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '460', productSellAllPrice = '480', productSellUnitPrice = '480', productSellHalfPrice = '480', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01871',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480.00',lastbuyprice_withDiscount = '480',meanbuyprice = '480.00',meanbuyprice_withDiscount = '480' , productbuypricereal = '480' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='480',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='480',meanbuyprice_withTax='480',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='480',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1871';
UPDATE user SET loginip = "" WHERE userid = 2;
UPDATE productunit SET unitid = '1', productid = '1873', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0187301',proUnitSellAllPrice='470',proUnitSellHalfPrice='470',proUnitSellUnitPrice ='470',proUnitBuyPrice='470',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1873';
UPDATE product SET productName = 'موديل 163 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '460', productSellAllPrice = '470', productSellUnitPrice = '470', productSellHalfPrice = '470', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01873',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470.00',lastbuyprice_withDiscount = '470',meanbuyprice = '470.00',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1873';
UPDATE productunit SET unitid = '1', productid = '1874', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0187401',proUnitSellAllPrice='520',proUnitSellHalfPrice='520',proUnitSellUnitPrice ='520',proUnitBuyPrice='520',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1874';
UPDATE product SET productName = 'موديل 165 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '500', productSellAllPrice = '520', productSellUnitPrice = '520', productSellHalfPrice = '520', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01874',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '520.00',lastbuyprice_withDiscount = '520',meanbuyprice = '520.00',meanbuyprice_withDiscount = '520' , productbuypricereal = '520' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='520',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='520',meanbuyprice_withTax='520',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='520',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1874';
UPDATE productunit SET unitid = '1', productid = '1875', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0187501',proUnitSellAllPrice='590',proUnitSellHalfPrice='590',proUnitSellUnitPrice ='590',proUnitBuyPrice='590',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1875';
UPDATE product SET productName = 'موديل 166 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '570', productSellAllPrice = '590', productSellUnitPrice = '590', productSellHalfPrice = '590', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01875',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '590.00',lastbuyprice_withDiscount = '590',meanbuyprice = '590.00',meanbuyprice_withDiscount = '590' , productbuypricereal = '590' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='590',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='590',meanbuyprice_withTax='590',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='590',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1875';
UPDATE productunit SET unitid = '1', productid = '1865', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0186501',proUnitSellAllPrice='510',proUnitSellHalfPrice='510',proUnitSellUnitPrice ='510',proUnitBuyPrice='510',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1865';
UPDATE product SET productName = 'موديل 152 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '490', productSellAllPrice = '510', productSellUnitPrice = '510', productSellHalfPrice = '510', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01865',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510.00',lastbuyprice_withDiscount = '510',meanbuyprice = '510.00',meanbuyprice_withDiscount = '510' , productbuypricereal = '510' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',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='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 = '1865';
UPDATE productunit SET unitid = '1', productid = '1873', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0187301',proUnitSellAllPrice='470',proUnitSellHalfPrice='470',proUnitSellUnitPrice ='470',proUnitBuyPrice='470',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1873';
UPDATE product SET productName = 'موديل 163 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '460', productSellAllPrice = '470', productSellUnitPrice = '470', productSellHalfPrice = '470', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01873',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470.00',lastbuyprice_withDiscount = '470',meanbuyprice = '470.00',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='470',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1873';
UPDATE productunit SET unitid = '1', productid = '1875', productnumber = '1.00', productunitdate = '2026-10-12', userid = '1', conditions = '0',proUnitParcode='0187501',proUnitSellAllPrice='590',proUnitSellHalfPrice='590',proUnitSellUnitPrice ='590',proUnitBuyPrice='590',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1875';
UPDATE product SET productName = 'موديل 166 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '570', productSellAllPrice = '590', productSellUnitPrice = '590', productSellHalfPrice = '590', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01875',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '590.00',lastbuyprice_withDiscount = '590',meanbuyprice = '590.00',meanbuyprice_withDiscount = '590' , productbuypricereal = '590' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='590',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='590',meanbuyprice_withTax='590',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='590',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1875';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:09:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:39:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 15:39:06', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=7788
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 ('06accd109d8a50', '2026-10-12 15:22:33', '156', '0.00', '185470', '0', '0', '185470.00',  '185470.00', '0', '185470', '1', '2026-10-12 15:39:07', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=113
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 ('01863', '113', '146', '1863', '24', '420', '10080.00', '0', '', '2026-10-12 15:39:07', '1863','','','0','0','0','0','0',null,'420','10080','0','0','0','0','0','0','0','0','1'); -- id=715
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1863, 0, 0
                    , 420, 24, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=934
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1863', '420', '24', '0', 'buyBillController.php', '715', '', '0', '0'); -- id=552
UPDATE product SET  productBuyPrice = "420" WHERE productId = 1863 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 715 ;
UPDATE product SET productName = 'موديل150 تاي بوكس', productDescription = '', productCatId = '146', productBuyPrice = '420.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01863',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420',lastbuyprice_withDiscount = '420',meanbuyprice = '420',meanbuyprice_withDiscount = '420' , productbuypricereal = '440.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='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='420',meanbuyprice_withTax='420',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='420',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1863';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 715;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 1863;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2880';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1863', '1', '24', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 15:22:33','0','0'); -- id=4805
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 ('01864', '113', '146', '1864', '28', '470', '13160.00', '0', '', '2026-10-12 15:39:07', '1864','','','0','0','0','0','0',null,'470','13160','0','0','0','0','0','0','0','0','1'); -- id=716
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1864, 0, 0
                    , 470, 28, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 470,
                        buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=935
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1864', '470', '28', '0', 'buyBillController.php', '716', '', '0', '0'); -- id=553
UPDATE product SET  productBuyPrice = "470" WHERE productId = 1864 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 716 ;
UPDATE product SET productName = 'موديل 151 تاي بوكس', productDescription = '', productCatId = '146', productBuyPrice = '470.00', productSellAllPrice = '490.00', productSellUnitPrice = '490.00', productSellHalfPrice = '490.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01864',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '490.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='490',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1864';
UPDATE buybilldetail SET  lastbuyprice = 470 , meanbuyprice = 470, lastbuyprice_withDiscount = 470, meanbuyprice_withDiscount = 470
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 470
                where buybilldetailid = 716;
UPDATE productunit SET proUnitBuyPrice  = 470 * productnumber WHERE productid = 1864;
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2881';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1864', '1', '28', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '28', '1', '2026-10-12 15:22:33','0','0'); -- id=4806
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 ('01866', '113', '146', '1866', '24', '370', '8880.00', '0', '', '2026-10-12 15:39:07', '1866','','','0','0','0','0','0',null,'370','8880','0','0','0','0','0','0','0','0','1'); -- id=717
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1866, 0, 0
                    , 370, 24, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 370,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=936
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1866', '370', '24', '0', 'buyBillController.php', '717', '', '0', '0'); -- id=554
UPDATE product SET  productBuyPrice = "370" WHERE productId = 1866 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 717 ;
UPDATE product SET productName = 'موديل 153 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '370.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01866',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '370',meanbuyprice = '370',meanbuyprice_withDiscount = '370' , productbuypricereal = '390.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='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='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 = '1866';
UPDATE buybilldetail SET  lastbuyprice = 370 , meanbuyprice = 370, lastbuyprice_withDiscount = 370, meanbuyprice_withDiscount = 370
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 370
                where buybilldetailid = 717;
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 1866;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2883';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1866', '1', '24', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 15:22:33','0','0'); -- id=4807
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 ('01867', '113', '146', '1867', '32', '550', '17600.00', '0', '', '2026-10-12 15:39:07', '1867','','','0','0','0','0','0',null,'550','17600','0','0','0','0','0','0','0','0','1'); -- id=718
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1867, 0, 0
                    , 550, 32, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 550,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=937
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1867', '550', '32', '0', 'buyBillController.php', '718', '', '0', '0'); -- id=555
UPDATE product SET  productBuyPrice = "550" WHERE productId = 1867 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 718 ;
UPDATE product SET productName = 'موديل 154 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '550.00', productSellAllPrice = '570.00', productSellUnitPrice = '570.00', productSellHalfPrice = '570.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01867',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '550',meanbuyprice_withDiscount = '550' , productbuypricereal = '570.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='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='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 = '1867';
UPDATE buybilldetail SET  lastbuyprice = 550 , meanbuyprice = 550, lastbuyprice_withDiscount = 550, meanbuyprice_withDiscount = 550
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 550
                where buybilldetailid = 718;
UPDATE productunit SET proUnitBuyPrice  = 550 * productnumber WHERE productid = 1867;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2884';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1867', '1', '32', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '32', '1', '2026-10-12 15:22:33','0','0'); -- id=4808
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 ('01868', '113', '146', '1868', '24', '810', '19440.00', '0', '', '2026-10-12 15:39:07', '1868','','','0','0','0','0','0',null,'810','19440','0','0','0','0','0','0','0','0','1'); -- id=719
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1868, 0, 0
                    , 810, 24, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 810,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=938
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1868', '810', '24', '0', 'buyBillController.php', '719', '', '0', '0'); -- id=556
UPDATE product SET  productBuyPrice = "810" WHERE productId = 1868 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 719 ;
UPDATE product SET productName = 'موديل 156 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '810.00', productSellAllPrice = '830.00', productSellUnitPrice = '830.00', productSellHalfPrice = '830.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01868',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '810',lastbuyprice_withDiscount = '810',meanbuyprice = '810',meanbuyprice_withDiscount = '810' , productbuypricereal = '830.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='830',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='810',meanbuyprice_withTax='810',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='810',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1868';
UPDATE buybilldetail SET  lastbuyprice = 810 , meanbuyprice = 810, lastbuyprice_withDiscount = 810, meanbuyprice_withDiscount = 810
        , lastbuyprice_withTax = 810, meanbuyprice_withTax = 810, lastbuyprice_withDiscountAndTax = 810
                where buybilldetailid = 719;
UPDATE productunit SET proUnitBuyPrice  = 810 * productnumber WHERE productid = 1868;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2885';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1868', '1', '24', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 15:22:33','0','0'); -- id=4809
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 ('01869', '113', '146', '1869', '56', '350', '19600.00', '0', '', '2026-10-12 15:39:07', '1869','','','0','0','0','0','0',null,'350','19600','0','0','0','0','0','0','0','0','1'); -- id=720
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1869, 0, 0
                    , 350, 56, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 350,
                        buyQuantity =buyQuantity+56, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=939
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1869', '350', '56', '0', 'buyBillController.php', '720', '', '0', '0'); -- id=557
UPDATE product SET  productBuyPrice = "350" WHERE productId = 1869 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 720 ;
UPDATE product SET productName = 'موديل 157 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '350.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01869',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '370.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='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='350',meanbuyprice_withTax='350',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='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 = '1869';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 350, meanbuyprice_withDiscount = 350
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where buybilldetailid = 720;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1869;
UPDATE storedetail SET  productquantity = '56', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2886';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1869', '1', '56', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '56', '1', '2026-10-12 15:22:33','0','0'); -- id=4810
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 ('01870', '113', '146', '1870', '20', '480', '9600.00', '0', '', '2026-10-12 15:39:07', '1870','','','0','0','0','0','0',null,'480','9600','0','0','0','0','0','0','0','0','1'); -- id=721
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1870, 0, 0
                    , 480, 20, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 480,
                        buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=940
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1870', '480', '20', '0', 'buyBillController.php', '721', '', '0', '0'); -- id=558
UPDATE product SET  productBuyPrice = "480" WHERE productId = 1870 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 721 ;
UPDATE product SET productName = 'موديل 158 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '480.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01870',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '480',meanbuyprice_withDiscount = '480' , productbuypricereal = '500.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='500',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='480',meanbuyprice_withTax='480',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='480',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1870';
UPDATE buybilldetail SET  lastbuyprice = 480 , meanbuyprice = 480, lastbuyprice_withDiscount = 480, meanbuyprice_withDiscount = 480
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 480, lastbuyprice_withDiscountAndTax = 480
                where buybilldetailid = 721;
UPDATE productunit SET proUnitBuyPrice  = 480 * productnumber WHERE productid = 1870;
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2887';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1870', '1', '20', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '20', '1', '2026-10-12 15:22:33','0','0'); -- id=4811
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 ('01871', '113', '146', '1871', '28', '460', '12880.00', '0', '', '2026-10-12 15:39:07', '1871','','','0','0','0','0','0',null,'460','12880','0','0','0','0','0','0','0','0','1'); -- id=722
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1871, 0, 0
                    , 460, 28, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=941
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1871', '460', '28', '0', 'buyBillController.php', '722', '', '0', '0'); -- id=559
UPDATE product SET  productBuyPrice = "460" WHERE productId = 1871 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 722 ;
UPDATE product SET productName = 'موديل 161 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '460.00', productSellAllPrice = '480.00', productSellUnitPrice = '480.00', productSellHalfPrice = '480.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01871',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '480.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='480',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '1871';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 722;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 1871;
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2888';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1871', '1', '28', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '28', '1', '2026-10-12 15:22:33','0','0'); -- id=4812
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 ('01872', '113', '146', '1872', '21', '470', '9870.00', '0', '', '2026-10-12 15:39:07', '1872','','','0','0','0','0','0',null,'470','9870','0','0','0','0','0','0','0','0','1'); -- id=723
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1872, 0, 0
                    , 470, 21, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 470,
                        buyQuantity =buyQuantity+21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=942
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1872', '470', '21', '0', 'buyBillController.php', '723', '', '0', '0'); -- id=560
UPDATE product SET  productBuyPrice = "470" WHERE productId = 1872 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 723 ;
UPDATE product SET productName = 'موديل 162 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '470.00', productSellAllPrice = '490.00', productSellUnitPrice = '490.00', productSellHalfPrice = '490.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01872',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '490.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='490',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='470',meanbuyprice_withTax='470',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='470',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1872';
UPDATE buybilldetail SET  lastbuyprice = 470 , meanbuyprice = 470, lastbuyprice_withDiscount = 470, meanbuyprice_withDiscount = 470
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 470
                where buybilldetailid = 723;
UPDATE productunit SET proUnitBuyPrice  = 470 * productnumber WHERE productid = 1872;
UPDATE storedetail SET  productquantity = '21', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2889';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1872', '1', '21', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '21', '1', '2026-10-12 15:22:33','0','0'); -- id=4813
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 ('01873', '113', '146', '1873', '24', '450', '10800.00', '0', '', '2026-10-12 15:39:07', '1873','','','0','0','0','0','0',null,'450','10800','0','0','0','0','0','0','0','0','1'); -- id=724
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1873, 0, 0
                    , 450, 24, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 450,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=943
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1873', '450', '24', '0', 'buyBillController.php', '724', '', '0', '0'); -- id=561
UPDATE product SET  productBuyPrice = "450" WHERE productId = 1873 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 724 ;
UPDATE product SET productName = 'موديل 163 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '450.00', productSellAllPrice = '470.00', productSellUnitPrice = '470.00', productSellHalfPrice = '470.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01873',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '450',meanbuyprice_withDiscount = '450' , productbuypricereal = '470.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='470',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='450',meanbuyprice_withTax='450',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='450',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1873';
UPDATE buybilldetail SET  lastbuyprice = 450 , meanbuyprice = 450, lastbuyprice_withDiscount = 450, meanbuyprice_withDiscount = 450
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 450
                where buybilldetailid = 724;
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 1873;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2890';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1873', '1', '24', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 15:22:33','0','0'); -- id=4814
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 ('01874', '113', '146', '1874', '16', '500', '8000.00', '0', '', '2026-10-12 15:39:07', '1874','','','0','0','0','0','0',null,'500','8000','0','0','0','0','0','0','0','0','1'); -- id=725
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1874, 0, 0
                    , 500, 16, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 500,
                        buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=944
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1874', '500', '16', '0', 'buyBillController.php', '725', '', '0', '0'); -- id=562
UPDATE product SET  productBuyPrice = "500" WHERE productId = 1874 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 725 ;
UPDATE product SET productName = 'موديل 165 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '500.00', productSellAllPrice = '520.00', productSellUnitPrice = '520.00', productSellHalfPrice = '520.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01874',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '520.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='520',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='500',meanbuyprice_withTax='500',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='500',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1874';
UPDATE buybilldetail SET  lastbuyprice = 500 , meanbuyprice = 500, lastbuyprice_withDiscount = 500, meanbuyprice_withDiscount = 500
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 500
                where buybilldetailid = 725;
UPDATE productunit SET proUnitBuyPrice  = 500 * productnumber WHERE productid = 1874;
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2891';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1874', '1', '16', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '16', '1', '2026-10-12 15:22:33','0','0'); -- id=4815
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 ('01875', '113', '146', '1875', '28', '570', '15960.00', '0', '', '2026-10-12 15:39:07', '1875','','','0','0','0','0','0',null,'570','15960','0','0','0','0','0','0','0','0','1'); -- id=726
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1875, 0, 0
                    , 570, 28, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 570,
                        buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=945
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1875', '570', '28', '0', 'buyBillController.php', '726', '', '0', '0'); -- id=563
UPDATE product SET  productBuyPrice = "570" WHERE productId = 1875 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 726 ;
UPDATE product SET productName = 'موديل 166 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '570.00', productSellAllPrice = '590.00', productSellUnitPrice = '590.00', productSellHalfPrice = '590.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01875',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '570',lastbuyprice_withDiscount = '570',meanbuyprice = '570',meanbuyprice_withDiscount = '570' , productbuypricereal = '590.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='590',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 = '1875';
UPDATE buybilldetail SET  lastbuyprice = 570 , meanbuyprice = 570, lastbuyprice_withDiscount = 570, meanbuyprice_withDiscount = 570
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 570, lastbuyprice_withDiscountAndTax = 570
                where buybilldetailid = 726;
UPDATE productunit SET proUnitBuyPrice  = 570 * productnumber WHERE productid = 1875;
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2892';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1875', '1', '28', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '28', '1', '2026-10-12 15:22:33','0','0'); -- id=4816
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 ('01876', '113', '146', '1876', '24', '580', '13920.00', '0', '', '2026-10-12 15:39:07', '1876','','','0','0','0','0','0',null,'580','13920','0','0','0','0','0','0','0','0','1'); -- id=727
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1876, 0, 0
                    , 580, 24, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 580,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=946
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1876', '580', '24', '0', 'buyBillController.php', '727', '', '0', '0'); -- id=564
UPDATE product SET  productBuyPrice = "580" WHERE productId = 1876 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 727 ;
UPDATE product SET productName = 'موديل 167 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '580.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01876',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580',lastbuyprice_withDiscount = '580',meanbuyprice = '580',meanbuyprice_withDiscount = '580' , 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='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 = '1876';
UPDATE buybilldetail SET  lastbuyprice = 580 , meanbuyprice = 580, lastbuyprice_withDiscount = 580, meanbuyprice_withDiscount = 580
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where buybilldetailid = 727;
UPDATE productunit SET proUnitBuyPrice  = 580 * productnumber WHERE productid = 1876;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2893';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1876', '1', '24', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 15:22:33','0','0'); -- id=4817
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 ('01865', '113', '146', '1865', '32', '490', '15680.00', '0', '', '2026-10-12 15:39:07', '1865','','','0','0','0','0','0',null,'490','15680','0','0','0','0','0','0','0','0','1'); -- id=728
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:22:33', 1, 1865, 0, 0
                    , 490, 32, 0, 0, 1, '2026-10-12 15:39:07')
                ON DUPLICATE KEY UPDATE buyprice = 490,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 15:39:07' ; -- id=947
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1865', '490', '32', '0', 'buyBillController.php', '728', '', '0', '0'); -- id=565
UPDATE product SET  productBuyPrice = "490" WHERE productId = 1865 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 728 ;
UPDATE product SET productName = 'موديل 152 تاي بوكس ', productDescription = '', productCatId = '146', productBuyPrice = '490.00', productSellAllPrice = '510.00', productSellUnitPrice = '510.00', productSellHalfPrice = '510.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01865',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '490',lastbuyprice_withDiscount = '490',meanbuyprice = '490',meanbuyprice_withDiscount = '490' , 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='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='490',meanbuyprice_withTax='490',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='490',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1865';
UPDATE buybilldetail SET  lastbuyprice = 490 , meanbuyprice = 490, lastbuyprice_withDiscount = 490, meanbuyprice_withDiscount = 490
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 490
                where buybilldetailid = 728;
UPDATE productunit SET proUnitBuyPrice  = 490 * productnumber WHERE productid = 1865;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2882';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1865', '1', '32', '0', '113', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '32', '1', '2026-10-12 15:22:33','0','0'); -- id=4818
UPDATE supplier SET  suppliercurrentDebt = '185470',suppliercurrentDebtInCurrency= '185470' , userid = '1', supplierdate = '2026-10-12 15:39:07'   WHERE supplierid = '156';
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 ('156', '0.00', '185470', '0', 'اضافة فاتورة مشتريات', '113', '185470', '2026-10-12 15:22:33', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','185470','1','0','185470','185470','0',''); -- id=389
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '185470', '185470', '2026-10-12', '1', '0', '0', '2026-10-12 15:39:07','اضافة فاتورة مشتريات رقم 113','1','0',null,'0','113','buyBillController.php?do=details&id=113'); -- id=2134
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2134', '382', '185470', '','0'); -- id=2178
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20252001.95', 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 ('2134', '639', '185470', '','0'); -- id=2136
UPDATE accountstree SET name = 'تاي بوكس', customName = 'تاي بوكس', customNameEn = 'تاي بوكس', nameEn = 'تاي بوكس', parent = '81', accountNature = '1', theValue = '185470', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 15:22:48' WHERE id = '639';
update buybill set dailyentryid='2134,0' where buybillid=113;
COMMIT;
UPDATE product SET overAllAveragePrice = 420 WHERE productId = 1863;UPDATE product SET overAllAveragePrice = 470 WHERE productId = 1864;UPDATE product SET overAllAveragePrice = 490 WHERE productId = 1865;UPDATE product SET overAllAveragePrice = 370 WHERE productId = 1866;UPDATE product SET overAllAveragePrice = 550 WHERE productId = 1867;UPDATE product SET overAllAveragePrice = 810 WHERE productId = 1868;UPDATE product SET overAllAveragePrice = 350 WHERE productId = 1869;UPDATE product SET overAllAveragePrice = 480 WHERE productId = 1870;UPDATE product SET overAllAveragePrice = 460 WHERE productId = 1871;UPDATE product SET overAllAveragePrice = 470 WHERE productId = 1872;UPDATE product SET overAllAveragePrice = 450 WHERE productId = 1873;UPDATE product SET overAllAveragePrice = 500 WHERE productId = 1874;UPDATE product SET overAllAveragePrice = 570 WHERE productId = 1875;UPDATE product SET overAllAveragePrice = 580 WHERE productId = 1876;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:09:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:39:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 15:39:07', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=113'); -- id=7789
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:09:09";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:09:21";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:39:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 15:39:21', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=113&type=2'); -- id=7790
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:09:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:39:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 15:39:41', '2', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7791
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:09:41";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 15:39:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 15:39:41', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7792
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:09:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:39:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 15:39:42', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=7793
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:09:44";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:39:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:39:44', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7794
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:09:50";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:39:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 15:39:50', '1', 'editbill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=111'); -- id=7795
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:10:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:40:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 15:40:12', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7796
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:10:32";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:40:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 15:40:32', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=7797
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:10:35";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:40:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:40:35', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7798

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accd51053050
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 15:40:35', '06accd51053050', '1', '0.00', '0', '0', '1', '11000.00', '11000', '11000', '0', '1', '2026-10-12 15:40:35', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '20' ,'0','','','','','-1','0','0','0','0','0','11000','0','','0','0','11000','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=443
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','اضافة فاتورة مبيعات','443', '0', '2026-10-12 15:40:35', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '11000', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 15:40:35','0','0','',''); -- id=575
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 ('530','09607', '443', '37', '1095', '5', '550', '2750', '0', '', '0', '2026-10-12 15:40:35', '1095', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','550','2750','0','','0','0.00','0','0','0','0'); -- id=1567
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 1567;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1095, '2026-10-12', 2750, 2650, 2650
                    , 2650, 2650, 2650, 2650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2650, 2650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2750, 2650, 2650
                    , 2650, 2650, 2650, 2650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2650, 2650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 15:40:35' WHERE storedetailid = '1095';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1095', '1', '5', '1', '443', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '2', '2026-10-12 15:40:35','0','0'); -- id=4819
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 358;
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','01549', '443', '11', '1549', '5', '500', '2500', '0', '', '0', '2026-10-12 15:40:35', '1549', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','358-5,','1','1','0','0','500','2500','0','','0','0.00','0','0','0','0'); -- id=1568
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 = 1568;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1549, '2026-10-12', 2500, 2425, 2425
                    , 2425, 2425, 2425, 2425
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2425, 2425, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2500, sellCostBuyPrice =sellCostBuyPrice+2425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2425
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2425
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2500, 2425, 2425
                    , 2425, 2425, 2425, 2425
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2425, 2425, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2500, sellCostBuyPrice =sellCostBuyPrice+2425
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2425, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2425
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2425, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2425
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2425
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2425
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2425
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 15:40:35' WHERE storedetailid = '1574';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1549', '1', '5', '1', '443', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '25', '2', '2026-10-12 15:40:35','0','0'); -- id=4820
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 ('555','09642', '443', '8', '739', '5', '575', '2875', '0', '', '0', '2026-10-12 15:40:35', '739', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','575','2875','0','','0','0.00','0','0','0','0'); -- id=1569
UPDATE sellbilldetail SET  lastbuyprice = 555.00 , meanbuyprice = 555.00, lastbuyprice_withDiscount = 555.00, meanbuyprice_withDiscount = 555.00
        , lastbuyprice_withTax = 555, meanbuyprice_withTax = 555, lastbuyprice_withDiscountAndTax = 555
                where sellbilldetailid = 1569;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (739, '2026-10-12', 2875, 2775, 2775
                    , 2775, 2775, 2775, 2775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2775, 2775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2875, sellCostBuyPrice =sellCostBuyPrice+2775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2775
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2875, 2775, 2775
                    , 2775, 2775, 2775, 2775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2775, 2775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2875, sellCostBuyPrice =sellCostBuyPrice+2775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2775
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 15:40:35' WHERE storedetailid = '739';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('739', '1', '5', '1', '443', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '2', '2026-10-12 15:40:35','0','0'); -- id=4821
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 42;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('555','01350', '443', '31', '1350', '5', '575', '2875', '0', '', '0', '2026-10-12 15:40:35', '1350', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','42-5,','1','1','0','0','575','2875','0','','0','0.00','0','0','0','0'); -- id=1570
UPDATE sellbilldetail SET  lastbuyprice = 555.00 , meanbuyprice = 555.00, lastbuyprice_withDiscount = 555.00, meanbuyprice_withDiscount = 555.00
        , lastbuyprice_withTax = 555, meanbuyprice_withTax = 555
                where sellbilldetailid = 1570;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1350, '2026-10-12', 2875, 2775, 2775
                    , 2775, 2775, 2775, 2775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2775, 2775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2875, sellCostBuyPrice =sellCostBuyPrice+2775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2775
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2875, 2775, 2775
                    , 2775, 2775, 2775, 2775
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2775, 2775, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2875, sellCostBuyPrice =sellCostBuyPrice+2775
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2775, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2775
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2775, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2775
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2775
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2775
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2775
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-12 15:40:35' WHERE storedetailid = '1350';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1350', '1', '5', '1', '443', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '35', '2', '2026-10-12 15:40:35','0','0'); -- id=4822
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2561505',  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 ('2550505','11000', '0', '2', 'اضافة فاتورة مبيعات', '443', '2561505', '2026-10-12 15:40:35', '2',  'sellbillController.php','1','','0'); -- id=548
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '11000', '11000', '2026-10-12', '2', '0', '0', '2026-10-12 15:40:35','اضافة فاتورة مبيعات رقم 443','1','0',null,'0','443','sellbillController.php?do=showDetail&sellbillid=443'); -- id=2135
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2135', '419', '11000', '','0'); -- id=2179
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2561505', 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 ('2135', '143', '11000', '','0'); -- id=2137
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4415125', 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 ( '10625', '10625', '2026-10-12', '2', '0', '0', '2026-10-12 15:40:35','اضافة فاتورة مبيعات رقم 443 - صرف البضاعة من المخزن','1','0',null,'0','443','sellbillController.php?do=showDetail&sellbillid=443'); -- id=2136
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2136', '402', '10625', '','0'); -- id=2180
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4123103.75', 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 ('2136', '382', '10625', '','0'); -- id=2138
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20241376.95', 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='2135,0,2136' where sellbillid=443;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 11000, 10625, 10625
                    , 10625, 10625, 10625, 10625
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10625, 10625, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11000, sellCostBuyPrice =sellCostBuyPrice+10625
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10625, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10625
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10625, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10625
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10625
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10625
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10625
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 11000, 10625, 10625
                    , 10625, 10625, 10625, 10625
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10625, 10625, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11000, sellCostBuyPrice =sellCostBuyPrice+10625
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10625, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10625
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10625, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10625
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10625
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10625
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10625
                        , returnSellVal = returnSellVal+0, 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, 11000, 10625, 10625
                    , 10625, 10625, 10625, 10625, 10625, 10625)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+11000, netSellCostBuyPrice = netSellCostBuyPrice+10625
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+10625
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+10625
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+10625
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+10625
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+10625
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+10625
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+10625;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accd51053050 and sellbillId = 443 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:10:35";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:40:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:40:35', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7799
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:10:44";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:40:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:40:44', '2', 'showDetail', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=443'); -- id=7800
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:10:46";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:40:46", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:40:46', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7801
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:11:27";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:41:27", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:41:27', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7802

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accbfc825e84
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 15:41:27', '06accbfc825e84', '1', '0.00', '0', '0', '1', '3200.00', '3200', '3200', '0', '1', '2026-10-12 15:41:27', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','3200','0','','0','0','3200','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=444
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','444', '0', '2026-10-12 15:41:27', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3200', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 15:41:27','0','0','',''); -- id=576
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 891;
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 ('770','01844', '444', '143', '1844', '4', '800', '3200', '0', '', '0', '2026-10-12 15:41:27', '1844', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','891-4,','1','1','0','0','800','3200','0','','0','0.00','0','0','0','0'); -- id=1571
UPDATE sellbilldetail SET  lastbuyprice = 770.00 , meanbuyprice = 770.00, lastbuyprice_withDiscount = 770.00, meanbuyprice_withDiscount = 770.00
        , lastbuyprice_withTax = 770, meanbuyprice_withTax = 385, lastbuyprice_withDiscountAndTax = 770
                where sellbilldetailid = 1571;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1844, '2026-10-12', 3200, 3080, 3080
                    , 3080, 3080, 3080, 3080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 3080, 1540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3200, 3080, 3080
                    , 3080, 3080, 3080, 3080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3080, 1540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-12 15:41:27' WHERE storedetailid = '2861';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1844', '1', '4', '1', '444', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '20', '6', '2026-10-12 15:41:27','0','0'); -- id=4823
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '146140',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('142940','3200', '0', '4', 'اضافة فاتورة مبيعات', '444', '146140', '2026-10-12 15:41:27', '6',  'sellbillController.php','1','','0'); -- id=549
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3200', '3200', '2026-10-12', '6', '0', '0', '2026-10-12 15:41:27','اضافة فاتورة مبيعات رقم 444','1','0',null,'0','444','sellbillController.php?do=showDetail&sellbillid=444'); -- id=2137
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2137', '568', '3200', '','0'); -- id=2181
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '146140', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2137', '143', '3200', '','0'); -- id=2139
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4418325', 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 ( '3080', '3080', '2026-10-12', '6', '0', '0', '2026-10-12 15:41:27','اضافة فاتورة مبيعات رقم 444 - صرف البضاعة من المخزن','1','0',null,'0','444','sellbillController.php?do=showDetail&sellbillid=444'); -- id=2138
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2138', '402', '3080', '','0'); -- id=2182
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4126183.75', 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 ('2138', '382', '3080', '','0'); -- id=2140
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20238296.95', 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='2137,0,2138' where sellbillid=444;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 3200, 3080, 3080
                    , 3080, 3080, 3080, 3080
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3080, 1540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 3200, 3080, 3080
                    , 3080, 3080, 3080, 3080
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3080, 1540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1540
                        , returnSellVal = returnSellVal+0, 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, 3200, 3080, 3080
                    , 3080, 3080, 3080, 3080, 3080, 1540)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3200, netSellCostBuyPrice = netSellCostBuyPrice+3080
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3080
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3080
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3080
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3080
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3080
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3080
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1540;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accbfc825e84 and sellbillId = 444 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:11:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:41:28", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:41:28', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7803
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:16:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:46:49", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:46:49', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7804

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accd5780e4b2
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 15:46:49', '06accd5780e4b2', '1', '0.00', '0', '0', '1', '16500.00', '16500', '16500', '0', '1', '2026-10-12 15:46:49', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '24' ,'0','','','','','-1','0','0','0','0','0','16500','0','','0','0','16500','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=445
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','445', '0', '2026-10-12 15:46:49', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '16500', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 15:46:49','0','0','',''); -- id=577
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 648;
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 ('900','01735', '445', '133', '1735', '4', '900', '3600', '0', '', '0', '2026-10-12 15:46:49', '1735', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','648-4,','1','1','0','0','900','3600','0','','0','0.00','0','0','0','0'); -- id=1572
UPDATE sellbilldetail SET  lastbuyprice = 900.00 , meanbuyprice = 900.00, lastbuyprice_withDiscount = 900.00, meanbuyprice_withDiscount = 900.00
        , lastbuyprice_withTax = 900, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 900
                where sellbilldetailid = 1572;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1735, '2026-10-12', 3600, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 3600, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, 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+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-10-12', 3600, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3600, 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 = '16', userid = '6', storedetaildate = '2026-10-12 15:46:49' WHERE storedetailid = '2748';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1735', '1', '4', '1', '445', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '16', '6', '2026-10-12 15:46:49','0','0'); -- id=4824
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 345;
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 ('675','i0001500', '445', '108', '1500', '6', '700', '4200', '0', '', '0', '2026-10-12 15:46:49', '1500', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','345-6,','1','1','0','0','700','4200','0','','0','0.00','0','0','0','0'); -- id=1573
UPDATE sellbilldetail SET  lastbuyprice = 675.00 , meanbuyprice = 675.00, lastbuyprice_withDiscount = 675.00, meanbuyprice_withDiscount = 675.00
        , lastbuyprice_withTax = 675, meanbuyprice_withTax = 675, lastbuyprice_withDiscountAndTax = 675
                where sellbilldetailid = 1573;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1500, '2026-10-12', 4200, 4050, 4050
                    , 4050, 4050, 4050, 4050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 4200, 4050, 4050
                    , 4050, 4050, 4050, 4050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4050, 4050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-12 15:46:49' WHERE storedetailid = '1525';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1500', '1', '6', '1', '445', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '12', '6', '2026-10-12 15:46:49','0','0'); -- id=4825
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 647;
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','01734', '445', '133', '1734', '8', '750', '6000', '0', '', '0', '2026-10-12 15:46:49', '1734', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','647-8,','1','1','0','0','750','6000','0','','0','0.00','0','0','0','0'); -- id=1574
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 = 1574;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1734, '2026-10-12', 6000, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6000, 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+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-10-12', 6000, 6000, 6000
                    , 6000, 6000, 6000, 6000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6000, 6000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6000, 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 = '76', userid = '6', storedetaildate = '2026-10-12 15:46:49' WHERE storedetailid = '2747';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1734', '1', '8', '1', '445', 'اضافة فاتورة مبيعات', 'sellbillController.php', '84', '76', '6', '2026-10-12 15:46:49','0','0'); -- id=4826
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 560;
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 ('405','01696', '445', '129', '1696', '6', '450', '2700', '0', '', '0', '2026-10-12 15:46:49', '1696', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','560-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=1575
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 405.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 405
                where sellbilldetailid = 1575;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1696, '2026-10-12', 2700, 2700, 2700
                    , 2700, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2700, 2700, 2700
                    , 2700, 2430, 2430, 2430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '117', userid = '6', storedetaildate = '2026-10-12 15:46:49' WHERE storedetailid = '2708';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1696', '1', '6', '1', '445', 'اضافة فاتورة مبيعات', 'sellbillController.php', '123', '117', '6', '2026-10-12 15:46:49','0','0'); -- id=4827
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '162640',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('146140','16500', '0', '4', 'اضافة فاتورة مبيعات', '445', '162640', '2026-10-12 15:46:49', '6',  'sellbillController.php','1','','0'); -- id=550
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '16500', '16500', '2026-10-12', '6', '0', '0', '2026-10-12 15:46:49','اضافة فاتورة مبيعات رقم 445','1','0',null,'0','445','sellbillController.php?do=showDetail&sellbillid=445'); -- id=2139
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2139', '568', '16500', '','0'); -- id=2183
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '162640', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2139', '143', '16500', '','0'); -- id=2141
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4434825', 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 ( '16080', '16080', '2026-10-12', '6', '0', '0', '2026-10-12 15:46:49','اضافة فاتورة مبيعات رقم 445 - صرف البضاعة من المخزن','1','0',null,'0','445','sellbillController.php?do=showDetail&sellbillid=445'); -- id=2140
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2140', '402', '16080', '','0'); -- id=2184
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4142263.75', 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 ('2140', '382', '16080', '','0'); -- id=2142
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20222216.95', 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='2139,0,2140' where sellbillid=445;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 16500, 16350, 16350
                    , 16350, 16080, 16080, 16080
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,16350, 14550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+16500, sellCostBuyPrice =sellCostBuyPrice+16350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+16350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+16350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+16080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+16080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+16080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+16350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14550
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 16500, 16350, 16350
                    , 16350, 16080, 16080, 16080
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,16350, 14550, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+16500, sellCostBuyPrice =sellCostBuyPrice+16350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+16350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+16350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+16080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+16080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+16080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+16350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14550
                        , returnSellVal = returnSellVal+0, 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, 16500, 16350, 16350
                    , 16350, 16080, 16080, 16080, 16350, 14550)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+16500, netSellCostBuyPrice = netSellCostBuyPrice+16350
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+16350
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+16350
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+16080
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+16080
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+16080
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+16350
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+14550;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accd5780e4b2 and sellbillId = 445 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:16:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:46:49", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 15:46:49', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7805
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:21:04";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:51:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 15:51:04', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=113&type=2'); -- id=7806
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:21:05";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:51:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 15:51:05', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=113'); -- id=7807
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:21:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:51:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 15:51:06', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7808
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:21:09";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 15:51:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 15:51:09', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7809
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:31:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:01:03", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 16:01:03', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7810
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:31:14";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:42:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:12:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:12:07', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php'); -- id=7811
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:42:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:12:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:12:15', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=7812
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:42:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:12:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:12:26', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=7813
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:42:48";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:12:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:12:48', '1', 'editbill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=45'); -- id=7814
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:43:10";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:13:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 16:13:10', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7815
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:43:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:13:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 16:13:15', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7816
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:44:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:14:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:14:03', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=7817
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 ('06accd7bd3b145', '2026-10-12 15:51:09', '106', '-1371710.00', '-1188890', '0', '0', '182820.00',  '182820.00', '0', '182820', '1', '2026-10-12 16:14:03', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=114
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 ('01491', '114', '108', '1491', '60', '675', '40500.00', '0', '', '2026-10-12 16:14:03', '1491','','','0','0','0','0','0',null,'675','40500','0','0','0','0','0','0','0','0','1'); -- id=729
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:51:09', 1, 1491, 0, 0
                    , 675, 60, 0, 0, 1, '2026-10-12 16:14:03')
                ON DUPLICATE KEY UPDATE buyprice = 675,
                        buyQuantity =buyQuantity+60, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 16:14:03' ; -- id=948
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1491', '675', '60', '0', 'buyBillController.php', '729', '', '0', '0'); -- id=566
UPDATE product SET  productBuyPrice = "675" WHERE productId = 1491 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 729 ;
UPDATE product SET productName = 'جاكيت تمبو 700', productDescription = '', productCatId = '108', productBuyPrice = '675.00', productSellAllPrice = '700.00', productSellUnitPrice = '700.00', productSellHalfPrice = '700.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01491',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '675',lastbuyprice_withDiscount = '675',meanbuyprice = '675',meanbuyprice_withDiscount = '675' , productbuypricereal = '675.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.70' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='675',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='675',meanbuyprice_withTax='675',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='675',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1491';
UPDATE buybilldetail SET  lastbuyprice = 675 , meanbuyprice = 675, lastbuyprice_withDiscount = 675, meanbuyprice_withDiscount = 675
        , lastbuyprice_withTax = 675, meanbuyprice_withTax = 675, lastbuyprice_withDiscountAndTax = 675
                where buybilldetailid = 729;
UPDATE productunit SET proUnitBuyPrice  = 675 * productnumber WHERE productid = 1491;
UPDATE storedetail SET  productquantity = '60', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '1516';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1491', '1', '60', '0', '114', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '60', '1', '2026-10-12 15:51:09','0','0'); -- id=4828
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 ('01497', '114', '108', '1497', '36', '430', '15480.00', '0', '', '2026-10-12 16:14:03', '1497','','','0','0','0','0','0',null,'430','15480','0','0','0','0','0','0','0','0','1'); -- id=730
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:51:09', 1, 1497, 0, 0
                    , 430, 36, 0, 0, 1, '2026-10-12 16:14:03')
                ON DUPLICATE KEY UPDATE buyprice = 430,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 16:14:03' ; -- id=949
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1497', '430', '36', '0', 'buyBillController.php', '730', '', '0', '0'); -- id=567
UPDATE product SET  productBuyPrice = "430" WHERE productId = 1497 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 730 ;
UPDATE product SET productName = 'جاكت تمبو 450', productDescription = '', productCatId = '108', productBuyPrice = '430.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01497',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 = '1497';
UPDATE buybilldetail SET  lastbuyprice = 430 , meanbuyprice = 430, lastbuyprice_withDiscount = 430, meanbuyprice_withDiscount = 430
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where buybilldetailid = 730;
UPDATE productunit SET proUnitBuyPrice  = 430 * productnumber WHERE productid = 1497;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '1522';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1497', '1', '36', '0', '114', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '1', '2026-10-12 15:51:09','0','0'); -- id=4829
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 ('01861', '114', '108', '1861', '60', '600', '36000.00', '0', '', '2026-10-12 16:14:03', '1861','','','0','0','0','0','0',null,'600','36000','0','0','0','0','0','0','0','0','1'); -- id=731
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:51:09', 1, 1861, 0, 0
                    , 600, 60, 0, 0, 1, '2026-10-12 16:14:03')
                ON DUPLICATE KEY UPDATE buyprice = 600,
                        buyQuantity =buyQuantity+60, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 16:14:03' ; -- id=950
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1861', '600', '60', '0', 'buyBillController.php', '731', '', '0', '0'); -- id=568
UPDATE product SET  productBuyPrice = "600" WHERE productId = 1861 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 731 ;
UPDATE product SET productName = 'جاكيت تمبو 625', productDescription = '', productCatId = '108', productBuyPrice = '600.00', productSellAllPrice = '625.00', productSellUnitPrice = '625.00', productSellHalfPrice = '625.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01861',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 = '4.17' , 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='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 = '1861';
UPDATE buybilldetail SET  lastbuyprice = 600 , meanbuyprice = 600, lastbuyprice_withDiscount = 600, meanbuyprice_withDiscount = 600
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where buybilldetailid = 731;
UPDATE productunit SET proUnitBuyPrice  = 600 * productnumber WHERE productid = 1861;
UPDATE storedetail SET  productquantity = '60', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2878';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1861', '1', '60', '0', '114', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '60', '1', '2026-10-12 15:51:09','0','0'); -- id=4830
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 ('01862', '114', '108', '1862', '30', '580', '17400.00', '0', '', '2026-10-12 16:14:03', '1862','','','0','0','0','0','0',null,'580','17400','0','0','0','0','0','0','0','0','1'); -- id=732
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:51:09', 1, 1862, 0, 0
                    , 580, 30, 0, 0, 1, '2026-10-12 16:14:03')
                ON DUPLICATE KEY UPDATE buyprice = 580,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 16:14:03' ; -- id=951
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1862', '580', '30', '0', 'buyBillController.php', '732', '', '0', '0'); -- id=569
UPDATE product SET  productBuyPrice = "580" WHERE productId = 1862 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 732 ;
UPDATE product SET productName = 'جاكيت تمبو 600', productDescription = '', productCatId = '108', productBuyPrice = '580.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01862',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 = '1862';
UPDATE buybilldetail SET  lastbuyprice = 580 , meanbuyprice = 580, lastbuyprice_withDiscount = 580, meanbuyprice_withDiscount = 580
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where buybilldetailid = 732;
UPDATE productunit SET proUnitBuyPrice  = 580 * productnumber WHERE productid = 1862;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2879';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1862', '1', '30', '0', '114', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '1', '2026-10-12 15:51:09','0','0'); -- id=4831
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 ('01459', '114', '103', '1459', '72', '310', '22320.00', '0', '', '2026-10-12 16:14:03', '1459','','','0','0','0','0','0',null,'310','22320','0','0','0','0','0','0','0','0','1'); -- id=733
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:51:09', 1, 1459, 0, 0
                    , 310, 72, 0, 0, 1, '2026-10-12 16:14:03')
                ON DUPLICATE KEY UPDATE buyprice = 310,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 16:14:03' ; -- id=952
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1459', '310', '72', '0', 'buyBillController.php', '733', '', '0', '0'); -- id=570
UPDATE product SET  productBuyPrice = "310" WHERE productId = 1459 ;
UPDATE buybilldetail SET  quantitybefore = 13 WHERE buybilldetailid = 733 ;
UPDATE product SET productName = 'تي شيرت ميلتون تمبو 330', productDescription = '', productCatId = '103', productBuyPrice = '310.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01459',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '310',lastbuyprice_withDiscount = '310',meanbuyprice = '310',meanbuyprice_withDiscount = '310' , productbuypricereal = '310.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.45' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='310',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='310',meanbuyprice_withTax='310',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='310',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1459';
UPDATE buybilldetail SET  lastbuyprice = 310 , meanbuyprice = 310, lastbuyprice_withDiscount = 310, meanbuyprice_withDiscount = 310
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 310, lastbuyprice_withDiscountAndTax = 310
                where buybilldetailid = 733;
UPDATE productunit SET proUnitBuyPrice  = 310 * productnumber WHERE productid = 1459;
UPDATE storedetail SET  productquantity = '85', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '1484';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1459', '1', '72', '0', '114', 'اضافة فاتورة مشتريات', 'buyBillController.php', '13', '85', '1', '2026-10-12 15:51:09','0','0'); -- id=4832
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 ('01458', '114', '103', '1458', '72', '300', '21600.00', '0', '', '2026-10-12 16:14:03', '1458','','','0','0','0','0','0',null,'300','21600','0','0','0','0','0','0','0','0','1'); -- id=734
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:51:09', 1, 1458, 0, 0
                    , 300, 72, 0, 0, 1, '2026-10-12 16:14:03')
                ON DUPLICATE KEY UPDATE buyprice = 300,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 16:14:03' ; -- id=953
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1458', '300', '72', '0', 'buyBillController.php', '734', '', '0', '0'); -- id=571
UPDATE product SET  productBuyPrice = "300" WHERE productId = 1458 ;
UPDATE buybilldetail SET  quantitybefore = 18 WHERE buybilldetailid = 734 ;
UPDATE product SET productName = 'تي شيرت ميلتون تمبو 320', productDescription = '', productCatId = '103', productBuyPrice = '300.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01458',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '300',lastbuyprice_withDiscount = '300',meanbuyprice = '300',meanbuyprice_withDiscount = '300' , productbuypricereal = '300.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='300',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='300',meanbuyprice_withTax='300',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='300',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1458';
UPDATE buybilldetail SET  lastbuyprice = 300 , meanbuyprice = 300, lastbuyprice_withDiscount = 300, meanbuyprice_withDiscount = 300
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where buybilldetailid = 734;
UPDATE productunit SET proUnitBuyPrice  = 300 * productnumber WHERE productid = 1458;
UPDATE storedetail SET  productquantity = '90', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '1483';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1458', '1', '72', '0', '114', 'اضافة فاتورة مشتريات', 'buyBillController.php', '18', '90', '1', '2026-10-12 15:51:09','0','0'); -- id=4833
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 ('01462', '114', '103', '1462', '72', '410', '29520.00', '0', '', '2026-10-12 16:14:03', '1462','','','0','0','0','0','0',null,'410','29520','0','0','0','0','0','0','0','0','1'); -- id=735
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 15:51:09', 1, 1462, 0, 0
                    , 410, 72, 0, 0, 1, '2026-10-12 16:14:03')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 16:14:03' ; -- id=954
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1462', '410', '72', '0', 'buyBillController.php', '735', '', '0', '0'); -- id=572
UPDATE product SET  productBuyPrice = "410" WHERE productId = 1462 ;
UPDATE buybilldetail SET  quantitybefore = 156 WHERE buybilldetailid = 735 ;
UPDATE product SET productName = 'تي شيرت ميلتون تمبو 430', productDescription = '', productCatId = '103', productBuyPrice = '410.00', productSellAllPrice = '430.00', productSellUnitPrice = '430.00', productSellHalfPrice = '430.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01462',type ='0', expireDate = '0' , dailyentryId = '0',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 = '1462';
UPDATE buybilldetail SET  lastbuyprice = 410 , meanbuyprice = 410, lastbuyprice_withDiscount = 410, meanbuyprice_withDiscount = 410
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where buybilldetailid = 735;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1462;
UPDATE storedetail SET  productquantity = '228', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '1487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1462', '1', '72', '0', '114', 'اضافة فاتورة مشتريات', 'buyBillController.php', '156', '228', '1', '2026-10-12 15:51:09','0','0'); -- id=4834
UPDATE supplier SET  suppliercurrentDebt = '-1188890',suppliercurrentDebtInCurrency= '-1188890' , userid = '1', supplierdate = '2026-10-12 16:14:03'   WHERE supplierid = '106';
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 ('106', '-1371710.00', '182820', '0', 'اضافة فاتورة مشتريات', '114', '-1188890', '2026-10-12 15:51:09', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','182820','1','-1371710','182820','-1188890','0',''); -- id=390
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '182820', '182820', '2026-10-12', '1', '0', '0', '2026-10-12 16:14:03','اضافة فاتورة مشتريات رقم 114','1','0',null,'0','114','buyBillController.php?do=details&id=114'); -- id=2141
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2141', '382', '182820', '','0'); -- id=2185
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20405036.95', 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 ('2141', '589', '182820', '','0'); -- id=2143
UPDATE accountstree SET name = 'تمبو', customName = 'تمبو', customNameEn = 'تمبو', nameEn = 'تمبو', parent = '81', accountNature = '1', theValue = '-1188890', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-07 09:33:15' WHERE id = '589';
update buybill set dailyentryid='2141,0' where buybillid=114;
COMMIT;
UPDATE product SET overAllAveragePrice = 300 WHERE productId = 1458;UPDATE product SET overAllAveragePrice = 310 WHERE productId = 1459;UPDATE product SET overAllAveragePrice = 410 WHERE productId = 1462;UPDATE product SET overAllAveragePrice = 675 WHERE productId = 1491;UPDATE product SET overAllAveragePrice = 430 WHERE productId = 1497;UPDATE product SET overAllAveragePrice = 600 WHERE productId = 1861;UPDATE product SET overAllAveragePrice = 580 WHERE productId = 1862;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:44:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:14:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:14:03', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=114'); -- id=7818
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:44:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:14:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:14:20', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7819
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:44:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:14:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:14:26', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7820
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:44:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:14:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:14:28', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7821
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:44:43";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:14:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 16:14:43', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=7822
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:44:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:14:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 16:14:45', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=7823
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:44:58";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:45:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:15:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 16:15:00', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7824
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:45:00";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 16:15:00', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7825
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:57:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:27:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:27:51', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7826
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:58:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:28:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 16:28:00', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7827
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:58:37";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:28:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:28:37', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7828
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:59:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:29:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:29:00', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7829
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:59:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:29:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:29:53', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7830
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 12:59:59";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:29:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:29:59', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7831
UPDATE user SET loginip = "" WHERE userid = 6;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:05:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:35:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:35:49', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=7832
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 ('اسفنجي بالون كيمت اكس ','','75','360','360','360','360','2026-10-12','0','1','0','','0','0','0','0','0','360','360','360','360','360','0','0','0','0','.','0','0','0','360','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','360','360','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','360','0','0','0','0','0','0','','','0','0','0','0'); -- id=1877
UPDATE product SET productName = 'اسفنجي بالون كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '360', productSellAllPrice = '360', productSellUnitPrice = '360', productSellHalfPrice = '360', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01877',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1877';
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', '1877', '1', '2026-10-12', '1', '0','0187701','360','360','360','360','','0','0','0','0','0','0','0','0','0','0'); -- id=1877
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1877', '1', '0', '1', '2026-10-12'); -- id=2894
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1877', '1', '0', '0', '1877', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4835
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1877, 1,'2026-10-12 16:35:49',1)
                ON DUPLICATE KEY UPDATE productid = 1877, edited = 1, sysdate = '2026-10-12 16:35:49', userid = 1; -- id=2801
UPDATE product SET productName = 'اسفنجي بالون كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01877',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1877';
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 ('جبردين بني كميت اكس ','','75','370','370','370','370','2026-10-12','0','1','0','','0','0','0','0','0','370','370','370','370','370','0','0','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=1878
UPDATE product SET productName = 'جبردين بني كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '370', productSellAllPrice = '370', productSellUnitPrice = '370', productSellHalfPrice = '370', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01878',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 = '0' , 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 = '1878';
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', '1878', '1', '2026-10-12', '1', '0','0187801','370','370','370','370','','0','0','0','0','0','0','0','0','0','0'); -- id=1878
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1878', '1', '0', '1', '2026-10-12'); -- id=2895
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1878', '1', '0', '0', '1878', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4836
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1878, 1,'2026-10-12 16:35:49',1)
                ON DUPLICATE KEY UPDATE productid = 1878, edited = 1, sysdate = '2026-10-12 16:35:49', userid = 1; -- id=2802
UPDATE product SET productName = 'جبردين بني كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01878',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 = '0' , 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 = '1878';
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 ('ليجن كبسوله كميت اكس ','','75','390','390','390','390','2026-10-12','0','1','0','','0','0','0','0','0','390','390','390','390','390','0','0','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=1879
UPDATE product SET productName = 'ليجن كبسوله كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '390', productSellAllPrice = '390', productSellUnitPrice = '390', productSellHalfPrice = '390', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01879',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 = '0' , 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 = '1879';
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', '1879', '1', '2026-10-12', '1', '0','0187901','390','390','390','390','','0','0','0','0','0','0','0','0','0','0'); -- id=1879
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1879', '1', '0', '1', '2026-10-12'); -- id=2896
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1879', '1', '0', '0', '1879', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4837
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1879, 1,'2026-10-12 16:35:49',1)
                ON DUPLICATE KEY UPDATE productid = 1879, edited = 1, sysdate = '2026-10-12 16:35:49', userid = 1; -- id=2803
UPDATE product SET productName = 'ليجن كبسوله كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '390.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01879',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 = '0' , 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 = '1879';
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 ('ليجن t r كميت اكس ','','75','400','400','400','400','2026-10-12','0','1','0','','0','0','0','0','0','400','400','400','400','400','0','0','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','1','0','0','0','0','0','0','','400','0','0','0','0','0','0','','','0','0','0','0'); -- id=1880
UPDATE product SET productName = 'ليجن t r كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '400', productSellAllPrice = '400', productSellUnitPrice = '400', productSellHalfPrice = '400', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01880',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 = '0' , 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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '1880';
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', '1880', '1', '2026-10-12', '1', '0','0188001','400','400','400','400','','0','0','0','0','0','0','0','0','0','0'); -- id=1880
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1880', '1', '0', '1', '2026-10-12'); -- id=2897
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1880', '1', '0', '0', '1880', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4838
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1880, 1,'2026-10-12 16:35:49',1)
                ON DUPLICATE KEY UPDATE productid = 1880, edited = 1, sysdate = '2026-10-12 16:35:49', userid = 1; -- id=2804
UPDATE product SET productName = 'ليجن t r كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '400.00', productSellAllPrice = '400.00', productSellUnitPrice = '400.00', productSellHalfPrice = '400.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01880',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 = '0' , 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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',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 = '1880';
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 ('انترلوك شروال كميت اكس ','','75','365','365','365','365','2026-10-12','0','1','0','','0','0','0','0','0','365','365','365','365','365','0','0','0','0','.','0','0','0','365','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','365','365','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','365','0','0','0','0','0','0','','','0','0','0','0'); -- id=1881
UPDATE product SET productName = 'انترلوك شروال كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '365', productSellAllPrice = '365', productSellUnitPrice = '365', productSellHalfPrice = '365', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01881',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '365',lastbuyprice_withDiscount = '365',meanbuyprice = '365',meanbuyprice_withDiscount = '365' , productbuypricereal = '365' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='365',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='365',meanbuyprice_withTax='365',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='365',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1881';
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', '1881', '1', '2026-10-12', '1', '0','0188101','365','365','365','365','','0','0','0','0','0','0','0','0','0','0'); -- id=1881
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1881', '1', '0', '1', '2026-10-12'); -- id=2898
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1881', '1', '0', '0', '1881', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4839
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1881, 1,'2026-10-12 16:35:49',1)
                ON DUPLICATE KEY UPDATE productid = 1881, edited = 1, sysdate = '2026-10-12 16:35:49', userid = 1; -- id=2805
UPDATE product SET productName = 'انترلوك شروال كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '365.00', productSellAllPrice = '365.00', productSellUnitPrice = '365.00', productSellHalfPrice = '365.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01881',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '365',lastbuyprice_withDiscount = '365',meanbuyprice = '365',meanbuyprice_withDiscount = '365' , productbuypricereal = '365' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='365',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='365',meanbuyprice_withTax='365',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='365',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1881';
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 ('جبردين كبسوله كميت اكس ','','75','370','370','370','370','2026-10-12','0','1','0','','0','0','0','0','0','370','370','370','370','370','0','0','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=1882
UPDATE product SET productName = 'جبردين كبسوله كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '370', productSellAllPrice = '370', productSellUnitPrice = '370', productSellHalfPrice = '370', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01882',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 = '0' , 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 = '1882';
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', '1882', '1', '2026-10-12', '1', '0','0188201','370','370','370','370','','0','0','0','0','0','0','0','0','0','0'); -- id=1882
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1882', '1', '0', '1', '2026-10-12'); -- id=2899
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1882', '1', '0', '0', '1882', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4840
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1882, 1,'2026-10-12 16:35:49',1)
                ON DUPLICATE KEY UPDATE productid = 1882, edited = 1, sysdate = '2026-10-12 16:35:49', userid = 1; -- id=2806
UPDATE product SET productName = 'جبردين كبسوله كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01882',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 = '0' , 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 = '1882';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:05:50";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:35:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:35:51', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7833
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-10-12 16:36:50', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=157
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 ('157', '0', '', '0', 'إضافة مورد جديد', '157', '', '2026-10-12 16:36:50', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=391
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-10-12 16:36:50'); -- id=640
UPDATE supplier SET suppliername = 'كميت اكس', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-12', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='640',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '157';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:10:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:40:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:40:17', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=7834
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 ('06acce2370d3df', '2026-10-12 16:35:51', '157', '0.00', '94743', '10', '1', '105270.00',  '94743.00', '0', '94743', '1', '2026-10-12 16:40:17', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=115
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 ('01877', '115', '75', '1877', '60', '360', '21600.00', '0', '', '2026-10-12 16:40:17', '1877','','','0','0','0','0','0',null,'360','21600','0','0','0','0','0','0','0','0','1'); -- id=736
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1877, 0, 0
                    , 324, 60, 0, 0, 1, '2026-10-12 16:40:17')
                ON DUPLICATE KEY UPDATE buyprice = 324,
                        buyQuantity =buyQuantity+60, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 16:40:17' ; -- id=955
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1877', '360', '60', '0', 'buyBillController.php', '736', '', '0', '0'); -- id=573
UPDATE product SET  productBuyPrice = "360" WHERE productId = 1877 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 736 ;
UPDATE product SET productName = 'اسفنجي بالون كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01877',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '324',meanbuyprice = '360',meanbuyprice_withDiscount = '324' , productbuypricereal = '360.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='360',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='360',meanbuyprice_withTax='360',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='324',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1877';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 324, meanbuyprice_withDiscount = 324
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 324
                where buybilldetailid = 736;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 1877;
UPDATE storedetail SET  productquantity = '60', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2894';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1877', '1', '60', '0', '115', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '60', '1', '2026-10-12 16:35:51','0','0'); -- id=4841
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 ('01878', '115', '75', '1878', '51', '370', '18870.00', '0', '', '2026-10-12 16:40:17', '1878','','','0','0','0','0','0',null,'370','18870','0','0','0','0','0','0','0','0','1'); -- id=737
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1878, 0, 0
                    , 333, 51, 0, 0, 1, '2026-10-12 16:40:17')
                ON DUPLICATE KEY UPDATE buyprice = 333,
                        buyQuantity =buyQuantity+51, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 16:40:17' ; -- id=956
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1878', '370', '51', '0', 'buyBillController.php', '737', '', '0', '0'); -- id=574
UPDATE product SET  productBuyPrice = "370" WHERE productId = 1878 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 737 ;
UPDATE product SET productName = 'جبردين بني كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01878',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '333',meanbuyprice = '370',meanbuyprice_withDiscount = '333' , productbuypricereal = '370.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='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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='333',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1878';
UPDATE buybilldetail SET  lastbuyprice = 370 , meanbuyprice = 370, lastbuyprice_withDiscount = 333, meanbuyprice_withDiscount = 333
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 333
                where buybilldetailid = 737;
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 1878;
UPDATE storedetail SET  productquantity = '51', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2895';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1878', '1', '51', '0', '115', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '51', '1', '2026-10-12 16:35:51','0','0'); -- id=4842
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 ('01879', '115', '75', '1879', '32', '390', '12480.00', '0', '', '2026-10-12 16:40:17', '1879','','','0','0','0','0','0',null,'390','12480','0','0','0','0','0','0','0','0','1'); -- id=738
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1879, 0, 0
                    , 351, 32, 0, 0, 1, '2026-10-12 16:40:17')
                ON DUPLICATE KEY UPDATE buyprice = 351,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 16:40:17' ; -- id=957
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1879', '390', '32', '0', 'buyBillController.php', '738', '', '0', '0'); -- id=575
UPDATE product SET  productBuyPrice = "390" WHERE productId = 1879 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 738 ;
UPDATE product SET productName = 'ليجن كبسوله كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '390.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01879',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390',lastbuyprice_withDiscount = '351',meanbuyprice = '390',meanbuyprice_withDiscount = '351' , productbuypricereal = '390.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='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='351',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1879';
UPDATE buybilldetail SET  lastbuyprice = 390 , meanbuyprice = 390, lastbuyprice_withDiscount = 351, meanbuyprice_withDiscount = 351
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 351
                where buybilldetailid = 738;
UPDATE productunit SET proUnitBuyPrice  = 390 * productnumber WHERE productid = 1879;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2896';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1879', '1', '32', '0', '115', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '32', '1', '2026-10-12 16:35:51','0','0'); -- id=4843
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 ('01880', '115', '75', '1880', '51', '400', '20400.00', '0', '', '2026-10-12 16:40:17', '1880','','','0','0','0','0','0',null,'400','20400','0','0','0','0','0','0','0','0','1'); -- id=739
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1880, 0, 0
                    , 360, 51, 0, 0, 1, '2026-10-12 16:40:17')
                ON DUPLICATE KEY UPDATE buyprice = 360,
                        buyQuantity =buyQuantity+51, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 16:40:17' ; -- id=958
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1880', '400', '51', '0', 'buyBillController.php', '739', '', '0', '0'); -- id=576
UPDATE product SET  productBuyPrice = "400" WHERE productId = 1880 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 739 ;
UPDATE product SET productName = 'ليجن t r كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '400.00', productSellAllPrice = '400.00', productSellUnitPrice = '400.00', productSellHalfPrice = '400.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01880',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '360',meanbuyprice = '400',meanbuyprice_withDiscount = '360' , productbuypricereal = '400.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='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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1880';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 360, meanbuyprice_withDiscount = 360
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 360
                where buybilldetailid = 739;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 1880;
UPDATE storedetail SET  productquantity = '51', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2897';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1880', '1', '51', '0', '115', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '51', '1', '2026-10-12 16:35:51','0','0'); -- id=4844
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 ('01881', '115', '75', '1881', '54', '365', '19710.00', '0', '', '2026-10-12 16:40:17', '1881','','','0','0','0','0','0',null,'365','19710','0','0','0','0','0','0','0','0','1'); -- id=740
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1881, 0, 0
                    , 328.5, 54, 0, 0, 1, '2026-10-12 16:40:17')
                ON DUPLICATE KEY UPDATE buyprice = 328.5,
                        buyQuantity =buyQuantity+54, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 16:40:17' ; -- id=959
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1881', '365', '54', '0', 'buyBillController.php', '740', '', '0', '0'); -- id=577
UPDATE product SET  productBuyPrice = "365" WHERE productId = 1881 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 740 ;
UPDATE product SET productName = 'انترلوك شروال كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '365.00', productSellAllPrice = '365.00', productSellUnitPrice = '365.00', productSellHalfPrice = '365.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01881',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '365',lastbuyprice_withDiscount = '328.5',meanbuyprice = '365',meanbuyprice_withDiscount = '328.5' , productbuypricereal = '365.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='365',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='365',meanbuyprice_withTax='365',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='328.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 = '1881';
UPDATE buybilldetail SET  lastbuyprice = 365 , meanbuyprice = 365, lastbuyprice_withDiscount = 328.5, meanbuyprice_withDiscount = 328.5
        , lastbuyprice_withTax = 365, meanbuyprice_withTax = 365, lastbuyprice_withDiscountAndTax = 328.5
                where buybilldetailid = 740;
UPDATE productunit SET proUnitBuyPrice  = 365 * productnumber WHERE productid = 1881;
UPDATE storedetail SET  productquantity = '54', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2898';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1881', '1', '54', '0', '115', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '54', '1', '2026-10-12 16:35:51','0','0'); -- id=4845
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 ('01882', '115', '75', '1882', '33', '370', '12210.00', '0', '', '2026-10-12 16:40:17', '1882','','','0','0','0','0','0',null,'370','12210','0','0','0','0','0','0','0','0','1'); -- id=741
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1882, 0, 0
                    , 333, 33, 0, 0, 1, '2026-10-12 16:40:17')
                ON DUPLICATE KEY UPDATE buyprice = 333,
                        buyQuantity =buyQuantity+33, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 16:40:17' ; -- id=960
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1882', '370', '33', '0', 'buyBillController.php', '741', '', '0', '0'); -- id=578
UPDATE product SET  productBuyPrice = "370" WHERE productId = 1882 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 741 ;
UPDATE product SET productName = 'جبردين كبسوله كميت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01882',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '333',meanbuyprice = '370',meanbuyprice_withDiscount = '333' , productbuypricereal = '370.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='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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='333',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1882';
UPDATE buybilldetail SET  lastbuyprice = 370 , meanbuyprice = 370, lastbuyprice_withDiscount = 333, meanbuyprice_withDiscount = 333
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 333
                where buybilldetailid = 741;
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 1882;
UPDATE storedetail SET  productquantity = '33', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2899';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1882', '1', '33', '0', '115', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '33', '1', '2026-10-12 16:35:51','0','0'); -- id=4846
UPDATE supplier SET  suppliercurrentDebt = '94743',suppliercurrentDebtInCurrency= '94743' , userid = '1', supplierdate = '2026-10-12 16:40:17'   WHERE supplierid = '157';
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 ('157', '0.00', '94743', '0', 'اضافة فاتورة مشتريات', '115', '94743', '2026-10-12 16:35:51', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','94743','1','0','94743','94743','0',''); -- id=392
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '94743', '94743', '2026-10-12', '1', '0', '0', '2026-10-12 16:40:17','اضافة فاتورة مشتريات رقم 115','1','0',null,'0','115','buyBillController.php?do=details&id=115'); -- id=2142
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2142', '382', '94743', '','0'); -- id=2186
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20499779.95', 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 ('2142', '640', '94743', '','0'); -- id=2144
UPDATE accountstree SET name = 'كميت اكس', customName = 'كميت اكس', customNameEn = 'كميت اكس', nameEn = 'كميت اكس', parent = '81', accountNature = '1', theValue = '94743', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 16:36:50' WHERE id = '640';
update buybill set dailyentryid='2142,0' where buybillid=115;
COMMIT;
UPDATE product SET overAllAveragePrice = 324 WHERE productId = 1877;UPDATE product SET overAllAveragePrice = 333 WHERE productId = 1878;UPDATE product SET overAllAveragePrice = 351 WHERE productId = 1879;UPDATE product SET overAllAveragePrice = 360 WHERE productId = 1880;UPDATE product SET overAllAveragePrice = 328.5 WHERE productId = 1881;UPDATE product SET overAllAveragePrice = 333 WHERE productId = 1882;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:10:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:40:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:40:17', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=115'); -- id=7835
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:10:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:40:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:40:20', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=115&type=2'); -- id=7836
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:14:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:44:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:44:08', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=115&type=2'); -- id=7837
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:14:10";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:44:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:44:10', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=115'); -- id=7838
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:14:10";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:44:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:44:10', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7839
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:14:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:44:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:44:16', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7840
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:14:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:44:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:44:18', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7841
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:14:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:44:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:44:45', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7842
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:15:39";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:15:39";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:15:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:45:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 16:45:41', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7843
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:15:41";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 16:45:41', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7844
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:15:52";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:45:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:45:52', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7845
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:15:55";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:45:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:45:55', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=7846
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:16:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:46:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:46:42', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7847
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:17:04";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:47:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:47:04', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7848
UPDATE product SET productName = 'جبردين بني كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01878',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370.00',lastbuyprice_withDiscount = '333',meanbuyprice = '370.00',meanbuyprice_withDiscount = '333' , productbuypricereal = '370.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='333',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='333',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1878';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1878, 1,'2026-10-12 16:47:33',1)
                ON DUPLICATE KEY UPDATE productid = 1878, edited = 1, sysdate = '2026-10-12 16:47:33', userid = 1; -- id=2802
UPDATE product SET productName = 'ليجن كبسوله كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '390.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01879',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390.00',lastbuyprice_withDiscount = '351',meanbuyprice = '390.00',meanbuyprice_withDiscount = '351' , productbuypricereal = '390.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='351',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='351',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1879';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1879, 1,'2026-10-12 16:47:46',1)
                ON DUPLICATE KEY UPDATE productid = 1879, edited = 1, sysdate = '2026-10-12 16:47:46', userid = 1; -- id=2803
UPDATE product SET productName = 'ليجن t rكيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '400.00', productSellAllPrice = '400.00', productSellUnitPrice = '400.00', productSellHalfPrice = '400.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01880',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400.00',lastbuyprice_withDiscount = '360',meanbuyprice = '400.00',meanbuyprice_withDiscount = '360' , productbuypricereal = '400.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='360',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1880';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1880, 1,'2026-10-12 16:47:55',1)
                ON DUPLICATE KEY UPDATE productid = 1880, edited = 1, sysdate = '2026-10-12 16:47:55', userid = 1; -- id=2804
UPDATE product SET productName = 'انترلوك شروال كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '365.00', productSellAllPrice = '365.00', productSellUnitPrice = '365.00', productSellHalfPrice = '365.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01881',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '365.00',lastbuyprice_withDiscount = '328.5',meanbuyprice = '365.00',meanbuyprice_withDiscount = '328.5' , productbuypricereal = '365.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='328.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='365',meanbuyprice_withTax='365',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='328.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 = '1881';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1881, 1,'2026-10-12 16:48:01',1)
                ON DUPLICATE KEY UPDATE productid = 1881, edited = 1, sysdate = '2026-10-12 16:48:01', userid = 1; -- id=2805
UPDATE product SET productName = 'جبردين كبسوله كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01882',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370.00',lastbuyprice_withDiscount = '333',meanbuyprice = '370.00',meanbuyprice_withDiscount = '333' , productbuypricereal = '370.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='333',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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='333',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1882';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1882, 1,'2026-10-12 16:48:15',1)
                ON DUPLICATE KEY UPDATE productid = 1882, edited = 1, sysdate = '2026-10-12 16:48:15', userid = 1; -- id=2806
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:18:21";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:48:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 16:48:21', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=7849
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-10-12 16:49:55', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=158
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 ('158', '0', '', '0', 'إضافة مورد جديد', '158', '', '2026-10-12 16:49:55', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=393
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-10-12 16:49:55'); -- id=641
UPDATE supplier SET suppliername = 'كيمت اكس', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-12', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='641',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '158';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:21:41";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:21:41";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:21:44";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:51:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 16:51:44', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7850
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:21:44";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 16:51:44', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7851
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:21:47";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:51:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 16:51:47', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=7852
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:21:56";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:21:59";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:51:59", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 16:51:59', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7853
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:21:59";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 16:51:59", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 16:51:59', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7854
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:22:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:52:00", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 16:52:00', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7855
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:24:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:54:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 16:54:23', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7856
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:24:23";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 16:54:23', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7857
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:24:25";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:54:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 16:54:26', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7858
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:24:26";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 16:54:26', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7859
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:25:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:55:22", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 16:55:22', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7860

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acce600bcd5c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 16:55:22', '06acce600bcd5c', '1', '0.00', '0', '0', '1', '1800.00', '1800', '1800', '0', '1', '2026-10-12 16:55:22', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1800','0','','0','0','1800','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=446
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','446', '0', '2026-10-12 16:55:22', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1800', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 16:55:22','0','0','',''); -- id=578
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 951;
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','01862', '446', '108', '1862', '3', '600', '1800', '0', '', '0', '2026-10-12 16:55:22', '1862', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','951-3,','1','1','0','0','600','1800','0','','0','0.00','0','0','0','0'); -- id=1576
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 = 1576;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1862, '2026-10-12', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1740
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1740
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-12 16:55:22' WHERE storedetailid = '2879';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1862', '1', '3', '1', '446', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '27', '6', '2026-10-12 16:55:22','0','0'); -- id=4847
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '164440',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('162640','1800', '0', '4', 'اضافة فاتورة مبيعات', '446', '164440', '2026-10-12 16:55:22', '6',  'sellbillController.php','1','','0'); -- id=551
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1800', '1800', '2026-10-12', '6', '0', '0', '2026-10-12 16:55:23','اضافة فاتورة مبيعات رقم 446','1','0',null,'0','446','sellbillController.php?do=showDetail&sellbillid=446'); -- id=2143
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2143', '568', '1800', '','0'); -- id=2187
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '164440', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2143', '143', '1800', '','0'); -- id=2145
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4436625', 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 ( '1740', '1740', '2026-10-12', '6', '0', '0', '2026-10-12 16:55:23','اضافة فاتورة مبيعات رقم 446 - صرف البضاعة من المخزن','1','0',null,'0','446','sellbillController.php?do=showDetail&sellbillid=446'); -- id=2144
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2144', '402', '1740', '','0'); -- id=2188
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4144003.75', 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 ('2144', '382', '1740', '','0'); -- id=2146
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20498039.95', 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='2143,0,2144' where sellbillid=446;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1740
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1740, 1740, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1740
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1740
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1740
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1740
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1740
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1740
                        , returnSellVal = returnSellVal+0, 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, 1800, 1740, 1740
                    , 1740, 1740, 1740, 1740, 1740, 1740)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1800, netSellCostBuyPrice = netSellCostBuyPrice+1740
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1740
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1740
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1740
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1740
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1740
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1740
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1740;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acce600bcd5c and sellbillId = 446 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:25:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:55:23", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 16:55:23', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7861
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:26:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:56:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 16:56:22', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7862
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:27:27";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:57:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 16:57:27', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7863
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:27:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:57:49", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 16:57:49', '4', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7864

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accd1f0e1ad7
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 16:57:49', '06accd1f0e1ad7', '1', '0.00', '0', '0', '1', '2580.00', '2580', '2580', '0', '2', '2026-10-12 16:57:49', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2580','0','','0','0','2580','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=447
UPDATE client SET  clientdebt = '0', userid = '4' 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','اضافة فاتورة مبيعات','447', '0', '2026-10-12 16:57:49', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2580', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 16:57:49','0','0','',''); -- id=579
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 493;
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','01550', '447', '112', '1550', '6', '430', '2580', '0', '', '0', '2026-10-12 16:57:49', '1550', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','493-6,','1','1','0','0','430','2580','0','','0','0.00','0','0','0','0'); -- id=1577
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 = 1577;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1550, '2026-10-12', 2580, 2220, 2220
                    , 2220, 2220, 2220, 2220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2220, 2220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (2, '2026-10-12', 2580, 2220, 2220
                    , 2220, 2220, 2220, 2220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2220, 2220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '132', userid = '4', storedetaildate = '2026-10-12 16:57:49' WHERE storedetailid = '2562';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1550', '2', '6', '1', '447', 'اضافة فاتورة مبيعات', 'sellbillController.php', '138', '132', '4', '2026-10-12 16:57:49','0','0'); -- id=4848
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '528010',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('525430','2580', '0', '3', 'اضافة فاتورة مبيعات', '447', '528010', '2026-10-12 16:57:49', '4',  'sellbillController.php','1','','0'); -- id=552
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2580', '2580', '2026-10-12', '4', '0', '0', '2026-10-12 16:57:49','اضافة فاتورة مبيعات رقم 447','1','0',null,'0','447','sellbillController.php?do=showDetail&sellbillid=447'); -- id=2145
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2145', '501', '2580', '','0'); -- id=2189
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '528010', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2145', '143', '2580', '','0'); -- id=2147
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4439205', 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 ( '2220', '2220', '2026-10-12', '4', '0', '0', '2026-10-12 16:57:49','اضافة فاتورة مبيعات رقم 447 - صرف البضاعة من المخزن','1','0',null,'0','447','sellbillController.php?do=showDetail&sellbillid=447'); -- id=2146
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2146', '402', '2220', '','0'); -- id=2190
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4146223.75', 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 ('2146', '492', '2220', '','0'); -- id=2148
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1122750', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='2145,0,2146' where sellbillid=447;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2580, 2220, 2220
                    , 2220, 2220, 2220, 2220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2220, 2220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2580, 2220, 2220
                    , 2220, 2220, 2220, 2220
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2220, 2220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2220
                        , returnSellVal = returnSellVal+0, 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, 2580, 2220, 2220
                    , 2220, 2220, 2220, 2220, 2220, 2220)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2580, netSellCostBuyPrice = netSellCostBuyPrice+2220
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2220
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2220
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2220
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2220
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2220
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2220
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2220;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accd1f0e1ad7 and sellbillId = 447 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:27:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:57:49", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 16:57:49', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7865
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:27:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:57:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 16:57:51', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=7866
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:27:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:57:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 16:57:58', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=7867
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:28:30";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 16:58:30", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 16:58:30', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7868
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:30:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:00:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:00:07', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7869

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accd54f04059
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 17:00:07', '06accd54f04059', '1', '0.00', '0', '0', '1', '2880.00', '2880', '2880', '0', '1', '2026-10-12 17:00:07', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '9' ,'0','','','','','-1','0','0','0','0','0','2880','0','','0','0','2880','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=448
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','اضافة فاتورة مبيعات','448', '0', '2026-10-12 17:00:07', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2880', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 17:00:07','0','0','',''); -- id=580
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 75;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','01383', '448', '94', '1383', '3', '330', '990', '0', '', '0', '2026-10-12 17:00:07', '1383', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','75-3,','1','1','0','0','330','990','0','','0','0.00','0','0','0','0'); -- id=1578
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 = 1578;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1383, '2026-10-12', 990, 900, 900
                    , 900, 900, 900, 900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 900, 900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 990, 900, 900
                    , 900, 900, 900, 900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 900, 900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '360', userid = '2', storedetaildate = '2026-10-12 17:00:07' WHERE storedetailid = '1383';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1383', '1', '3', '1', '448', 'اضافة فاتورة مبيعات', 'sellbillController.php', '363', '360', '2', '2026-10-12 17:00:07','0','0'); -- id=4849
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 71;
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 ('270','01379', '448', '94', '1379', '3', '300', '900', '0', '', '0', '2026-10-12 17:00:07', '1379', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','71-3,','1','1','0','0','300','900','0','','0','0.00','0','0','0','0'); -- id=1579
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 1579;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1379, '2026-10-12', 900, 810, 810
                    , 810, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 810, 810, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+810
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 900, 810, 810
                    , 810, 810, 810, 810
                    , 0, 0, 0, 0
                    , 0, 0, 0, 810, 810, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+900, sellCostBuyPrice =sellCostBuyPrice+810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+810
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '552', userid = '2', storedetaildate = '2026-10-12 17:00:07' WHERE storedetailid = '1379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1379', '1', '3', '1', '448', 'اضافة فاتورة مبيعات', 'sellbillController.php', '555', '552', '2', '2026-10-12 17:00:07','0','0'); -- id=4850
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 329;
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','01459', '448', '103', '1459', '3', '330', '990', '0', '', '0', '2026-10-12 17:00:07', '1459', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','329-3,','1','1','0','0','330','990','0','','0','0.00','0','0','0','0'); -- id=1580
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 = 1580;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1459, '2026-10-12', 990, 930, 930
                    , 930, 930, 930, 930
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 930, 930, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+930
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+930, sellCostMeanBuyPrice = sellCostMeanBuyPrice+930
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+930, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+930
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+930
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+930
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+930
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 990, 930, 930
                    , 930, 930, 930, 930
                    , 0, 0, 0, 0
                    , 0, 0, 0, 930, 930, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+930
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+930, sellCostMeanBuyPrice = sellCostMeanBuyPrice+930
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+930, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+930
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+930
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+930
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+930
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '82', userid = '2', storedetaildate = '2026-10-12 17:00:07' WHERE storedetailid = '1484';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1459', '1', '3', '1', '448', 'اضافة فاتورة مبيعات', 'sellbillController.php', '85', '82', '2', '2026-10-12 17:00:07','0','0'); -- id=4851
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2564385',  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 ('2561505','2880', '0', '2', 'اضافة فاتورة مبيعات', '448', '2564385', '2026-10-12 17:00:07', '2',  'sellbillController.php','1','','0'); -- id=553
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2880', '2880', '2026-10-12', '2', '0', '0', '2026-10-12 17:00:07','اضافة فاتورة مبيعات رقم 448','1','0',null,'0','448','sellbillController.php?do=showDetail&sellbillid=448'); -- id=2147
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2147', '419', '2880', '','0'); -- id=2191
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2564385', 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 ('2147', '143', '2880', '','0'); -- id=2149
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4442085', 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 ( '2640', '2640', '2026-10-12', '2', '0', '0', '2026-10-12 17:00:07','اضافة فاتورة مبيعات رقم 448 - صرف البضاعة من المخزن','1','0',null,'0','448','sellbillController.php?do=showDetail&sellbillid=448'); -- id=2148
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2148', '402', '2640', '','0'); -- id=2192
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4148863.75', 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 ('2148', '382', '2640', '','0'); -- id=2150
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20495399.95', 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='2147,0,2148' where sellbillid=448;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2880, 2640, 2640
                    , 2640, 2640, 2640, 2640
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2640, 2640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2880, 2640, 2640
                    , 2640, 2640, 2640, 2640
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2640, 2640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2640
                        , returnSellVal = returnSellVal+0, 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, 2880, 2640, 2640
                    , 2640, 2640, 2640, 2640, 2640, 2640)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2880, netSellCostBuyPrice = netSellCostBuyPrice+2640
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2640
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2640
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2640
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2640
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2640
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2640
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2640;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accd54f04059 and sellbillId = 448 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:30:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:00:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:00:07', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7870
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:30:37";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:00:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 17:00:37', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7871
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:30:43";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:00:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 17:00:43', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7872
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:54:39";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:24:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:24:39', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7873
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:54:43";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:24:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:24:43', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7874

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acce7e7cbfda
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 17:24:44', '06acce7e7cbfda', '1', '0.00', '0', '0', '1', '7350.00', '7350', '7350', '0', '1', '2026-10-12 17:24:44', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '17' ,'0','','','','','-1','0','0','0','0','0','7350','0','','0','0','7350','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=449
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','اضافة فاتورة مبيعات','449', '0', '2026-10-12 17:24:44', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '7350', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 17:24:44','0','0','',''); -- id=581
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 790;
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 ('405','01807', '449', '122', '1807', '3', '450', '1350', '0', '', '0', '2026-10-12 17:24:44', '1807', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','790-3,','1','1','0','0','450','1350','0','','0','0.00','0','0','0','0'); -- id=1581
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 405.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 405
                where sellbilldetailid = 1581;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1807, '2026-10-12', 1350, 1350, 1350
                    , 1350, 1215, 1215, 1215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1350, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1350, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1350, 1350, 1350
                    , 1350, 1215, 1215, 1215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1350, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1350, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '2', storedetaildate = '2026-10-12 17:24:44' WHERE storedetailid = '2821';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1807', '1', '3', '1', '449', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '21', '2', '2026-10-12 17:24:44','0','0'); -- id=4852
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 761;
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 ('410','01787', '449', '138', '1787', '6', '440', '2640', '0', '', '0', '2026-10-12 17:24:44', '1787', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','761-6,','1','1','0','0','440','2640','0','','0','0.00','0','0','0','0'); -- id=1582
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 1582;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1787, '2026-10-12', 2640, 2460, 2460
                    , 2460, 2460, 2460, 2460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2640, sellCostBuyPrice =sellCostBuyPrice+2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2640, 2460, 2460
                    , 2460, 2460, 2460, 2460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2640, sellCostBuyPrice =sellCostBuyPrice+2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 17:24:44' WHERE storedetailid = '2800';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1787', '1', '6', '1', '449', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '15', '2', '2026-10-12 17:24:44','0','0'); -- id=4853
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 154;
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 ('419.99','01404', '449', '99', '1404', '8', '420', '3360', '0', '', '0', '2026-10-12 17:24:44', '1404', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','154-8,','1','1','0','0','420','3360','0','','0','0.00','0','0','0','0'); -- id=1583
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 419.99, meanbuyprice_withDiscount = 419.99
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 419.99
                where sellbilldetailid = 1583;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1404, '2026-10-12', 3360, 3360, 3360
                    , 3360, 3359.92, 3359.92, 3359.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 3360, 3360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3360, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3359.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3359.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3359.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3360, 3360, 3360
                    , 3360, 3359.92, 3359.92, 3359.92
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3360, 3360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3360, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3359.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3359.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3359.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '512', userid = '2', storedetaildate = '2026-10-12 17:24:44' WHERE storedetailid = '1417';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1404', '1', '8', '1', '449', 'اضافة فاتورة مبيعات', 'sellbillController.php', '520', '512', '2', '2026-10-12 17:24:44','0','0'); -- id=4854
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2571735',  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 ('2564385','7350', '0', '2', 'اضافة فاتورة مبيعات', '449', '2571735', '2026-10-12 17:24:44', '2',  'sellbillController.php','1','','0'); -- id=554
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7350', '7350', '2026-10-12', '2', '0', '0', '2026-10-12 17:24:44','اضافة فاتورة مبيعات رقم 449','1','0',null,'0','449','sellbillController.php?do=showDetail&sellbillid=449'); -- id=2149
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2149', '419', '7350', '','0'); -- id=2193
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2571735', 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 ('2149', '143', '7350', '','0'); -- id=2151
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4449435', 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 ( '7034.92', '7034.92', '2026-10-12', '2', '0', '0', '2026-10-12 17:24:44','اضافة فاتورة مبيعات رقم 449 - صرف البضاعة من المخزن','1','0',null,'0','449','sellbillController.php?do=showDetail&sellbillid=449'); -- id=2150
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2150', '402', '7034.92', '','0'); -- id=2194
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4155898.67', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2150', '382', '7034.92', '','0'); -- id=2152
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20488365.03', 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='2149,0,2150' where sellbillid=449;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 7350, 7170, 7170
                    , 7170, 7034.92, 7034.92, 7034.92
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7170, 7170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7350, sellCostBuyPrice =sellCostBuyPrice+7170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7034.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7034.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7034.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7170
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 7350, 7170, 7170
                    , 7170, 7034.92, 7034.92, 7034.92
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7170, 7170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7350, sellCostBuyPrice =sellCostBuyPrice+7170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7034.92, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7034.92
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7034.92
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7170
                        , returnSellVal = returnSellVal+0, 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, 7350, 7170, 7170
                    , 7170, 7034.92, 7034.92, 7034.92, 7170, 7170)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+7350, netSellCostBuyPrice = netSellCostBuyPrice+7170
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+7170
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+7170
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+7034.92
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+7034.92
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+7034.92
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+7170
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+7170;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acce7e7cbfda and sellbillId = 449 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:54:44";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:24:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:24:44', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7875
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:55:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:25:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:25:41', '2', 'showDetail', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=449'); -- id=7876
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:55:44";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:25:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:25:44', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7877
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 13:59:01";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:29:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 17:29:01', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7878
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:02:32";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:02:34";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:32:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 17:32:34', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7879
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:02:35";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 17:32:35', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7880
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:02:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:32:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 17:32:38', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=7881
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:02:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:32:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 17:32:42', '1', 'editbill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=115'); -- id=7882
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:02:57";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:32:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 17:32:57', '1', 'update', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=7883
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 115;
UPDATE buybill SET  buybillsysdate = '2026-10-12 17:32:57', userid = '1',delbyuserid = '1', conditions = '1' WHERE buybillid = '115';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1877, 0, 0
                    , 360, 60, 0, 0, 1, '2026-10-12 17:32:57')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-60, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 17:32:57' ; -- id=955
UPDATE buybilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 324.00, meanbuyprice_withDiscount = 324.00
        , lastbuyprice_withTax = 360.00, meanbuyprice_withTax = 360.00, lastbuyprice_withDiscountAndTax = 324.00
                where buybilldetailid = 736;
UPDATE product SET productName = 'اسفنجي بالون كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01877',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '0',meanbuyprice = '360.00',meanbuyprice_withDiscount = '360' , productbuypricereal = '360.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='324',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='360',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 = '1877';
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 1877;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2894';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1877', '1', '60', '1', '115', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '60', '0', '1', '2026-10-12 16:35:51','0','0'); -- id=4855
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1878, 0, 0
                    , 370, 51, 0, 0, 1, '2026-10-12 17:32:57')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-51, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 17:32:57' ; -- id=956
UPDATE buybilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 333.00, meanbuyprice_withDiscount = 333.00
        , lastbuyprice_withTax = 370.00, meanbuyprice_withTax = 370.00, lastbuyprice_withDiscountAndTax = 333.00
                where buybilldetailid = 737;
UPDATE product SET productName = 'جبردين بني كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01878',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '0',meanbuyprice = '370.00',meanbuyprice_withDiscount = '370' , productbuypricereal = '370.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='333',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='0',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='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 = '1878';
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 1878;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2895';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1878', '1', '51', '1', '115', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '51', '0', '1', '2026-10-12 16:35:51','0','0'); -- id=4856
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1879, 0, 0
                    , 390, 32, 0, 0, 1, '2026-10-12 17:32:57')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-32, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 17:32:57' ; -- id=957
UPDATE buybilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 351.00, meanbuyprice_withDiscount = 351.00
        , lastbuyprice_withTax = 390.00, meanbuyprice_withTax = 390.00, lastbuyprice_withDiscountAndTax = 351.00
                where buybilldetailid = 738;
UPDATE product SET productName = 'ليجن كبسوله كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '390.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01879',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390',lastbuyprice_withDiscount = '0',meanbuyprice = '390.00',meanbuyprice_withDiscount = '390' , productbuypricereal = '390.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='351',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='0',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='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 = '1879';
UPDATE productunit SET proUnitBuyPrice  = 390 * productnumber WHERE productid = 1879;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2896';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1879', '1', '32', '1', '115', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '32', '0', '1', '2026-10-12 16:35:51','0','0'); -- id=4857
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1880, 0, 0
                    , 400, 51, 0, 0, 1, '2026-10-12 17:32:57')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-51, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 17:32:57' ; -- id=958
UPDATE buybilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 400.00, meanbuyprice_withTax = 400.00, lastbuyprice_withDiscountAndTax = 360.00
                where buybilldetailid = 739;
UPDATE product SET productName = 'ليجن t rكيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '400.00', productSellAllPrice = '400.00', productSellUnitPrice = '400.00', productSellHalfPrice = '400.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01880',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '0',meanbuyprice = '400.00',meanbuyprice_withDiscount = '400' , productbuypricereal = '400.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='360',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='0',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='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 = '1880';
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 1880;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2897';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1880', '1', '51', '1', '115', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '51', '0', '1', '2026-10-12 16:35:51','0','0'); -- id=4858
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1881, 0, 0
                    , 365, 54, 0, 0, 1, '2026-10-12 17:32:57')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-54, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 17:32:57' ; -- id=959
UPDATE buybilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 365.00, lastbuyprice_withDiscount = 328.50, meanbuyprice_withDiscount = 328.50
        , lastbuyprice_withTax = 365.00, meanbuyprice_withTax = 365.00, lastbuyprice_withDiscountAndTax = 328.50
                where buybilldetailid = 740;
UPDATE product SET productName = 'انترلوك شروال كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '365.00', productSellAllPrice = '365.00', productSellUnitPrice = '365.00', productSellHalfPrice = '365.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01881',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '365',lastbuyprice_withDiscount = '0',meanbuyprice = '365.00',meanbuyprice_withDiscount = '365' , productbuypricereal = '365.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='328.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='365',meanbuyprice_withTax='0',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='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 = '1881';
UPDATE productunit SET proUnitBuyPrice  = 365 * productnumber WHERE productid = 1881;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2898';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1881', '1', '54', '1', '115', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '54', '0', '1', '2026-10-12 16:35:51','0','0'); -- id=4859
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1882, 0, 0
                    , 370, 33, 0, 0, 1, '2026-10-12 17:32:57')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-33, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 17:32:57' ; -- id=960
UPDATE buybilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 333.00, meanbuyprice_withDiscount = 333.00
        , lastbuyprice_withTax = 370.00, meanbuyprice_withTax = 370.00, lastbuyprice_withDiscountAndTax = 333.00
                where buybilldetailid = 741;
UPDATE product SET productName = 'جبردين كبسوله كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01882',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '0',meanbuyprice = '370.00',meanbuyprice_withDiscount = '370' , productbuypricereal = '370.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='333',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='0',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='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 = '1882';
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 1882;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2899';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1882', '1', '33', '1', '115', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '33', '0', '1', '2026-10-12 16:35:51','0','0'); -- id=4860
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '0' , userid = '1', supplierdate = '2026-10-12 17:32:57'   WHERE supplierid = '157';
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 ('157', '94743.00', '94743.00', '1', 'حذف فاتورة مشتريات - للتعديل', '115', '0', '2026-10-12 16:35:51', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','94743','1','94743','94743','0','0',''); -- id=394
UPDATE productserial SET del = 1
		 WHERE billid = 115;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06acce2370d3df', '2026-10-12 16:35:51', '13', '-117475.00', '-22732', '10', '1', '105270.00', '94743.00', '0.00', '94743', '1', '2026-10-12 17:32:57', '', '1', '0', '', '1', '1','1','115','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=116
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 ('01877', '116', '75', '1877', '60.00', '360', '21600.00', '0.00', '', '2026-10-12 17:32:57', '1877','','','0','0','0','0','0',null,'360','21600','0','0','0','0','0','0','0','0','1'); -- id=742
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1877, 0, 0
                    , 324, 60, 0, 0, 1, '2026-10-12 17:32:57')
                ON DUPLICATE KEY UPDATE buyprice = 324,
                        buyQuantity =buyQuantity+60, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 17:32:57' ; -- id=955
UPDATE product SET  productBuyPrice = "360" WHERE productId = 1877 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 742 ;
UPDATE product SET productName = 'اسفنجي بالون كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '360.00', productSellHalfPrice = '360.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01877',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '324',meanbuyprice = '360',meanbuyprice_withDiscount = '342' , productbuypricereal = '360.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='324',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='360',meanbuyprice_withTax='180',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='324',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1877';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 324, meanbuyprice_withDiscount = 342
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 324
                where buybilldetailid = 742;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 1877;
UPDATE storedetail SET  productquantity = '60', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2894';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1877', '1', '60', '0', '116', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '60', '1', '2026-10-12 16:35:51','0','0'); -- id=4861
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 ('01878', '116', '75', '1878', '51.00', '370', '18870.00', '0.00', '', '2026-10-12 17:32:57', '1878','','','0','0','0','0','0',null,'370','18870','0','0','0','0','0','0','0','0','1'); -- id=743
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1878, 0, 0
                    , 333, 51, 0, 0, 1, '2026-10-12 17:32:57')
                ON DUPLICATE KEY UPDATE buyprice = 333,
                        buyQuantity =buyQuantity+51, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 17:32:57' ; -- id=956
UPDATE product SET  productBuyPrice = "370" WHERE productId = 1878 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 743 ;
UPDATE product SET productName = 'جبردين بني كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01878',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '333',meanbuyprice = '370',meanbuyprice_withDiscount = '351.5' , productbuypricereal = '370.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='333',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='185',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='333',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1878';
UPDATE buybilldetail SET  lastbuyprice = 370 , meanbuyprice = 370, lastbuyprice_withDiscount = 333, meanbuyprice_withDiscount = 351.5
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 185, lastbuyprice_withDiscountAndTax = 333
                where buybilldetailid = 743;
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 1878;
UPDATE storedetail SET  productquantity = '51', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2895';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1878', '1', '51', '0', '116', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '51', '1', '2026-10-12 16:35:51','0','0'); -- id=4862
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 ('01879', '116', '75', '1879', '32.00', '390', '12480.00', '0.00', '', '2026-10-12 17:32:57', '1879','','','0','0','0','0','0',null,'390','12480','0','0','0','0','0','0','0','0','1'); -- id=744
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1879, 0, 0
                    , 351, 32, 0, 0, 1, '2026-10-12 17:32:57')
                ON DUPLICATE KEY UPDATE buyprice = 351,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 17:32:57' ; -- id=957
UPDATE product SET  productBuyPrice = "390" WHERE productId = 1879 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 744 ;
UPDATE product SET productName = 'ليجن كبسوله كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '390.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01879',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390',lastbuyprice_withDiscount = '351',meanbuyprice = '390',meanbuyprice_withDiscount = '370.5' , productbuypricereal = '390.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='351',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='195',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='351',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1879';
UPDATE buybilldetail SET  lastbuyprice = 390 , meanbuyprice = 390, lastbuyprice_withDiscount = 351, meanbuyprice_withDiscount = 370.5
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 195, lastbuyprice_withDiscountAndTax = 351
                where buybilldetailid = 744;
UPDATE productunit SET proUnitBuyPrice  = 390 * productnumber WHERE productid = 1879;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2896';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1879', '1', '32', '0', '116', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '32', '1', '2026-10-12 16:35:51','0','0'); -- id=4863
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 ('01880', '116', '75', '1880', '51.00', '400', '20400.00', '0.00', '', '2026-10-12 17:32:57', '1880','','','0','0','0','0','0',null,'400','20400','0','0','0','0','0','0','0','0','1'); -- id=745
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1880, 0, 0
                    , 360, 51, 0, 0, 1, '2026-10-12 17:32:57')
                ON DUPLICATE KEY UPDATE buyprice = 360,
                        buyQuantity =buyQuantity+51, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 17:32:57' ; -- id=958
UPDATE product SET  productBuyPrice = "400" WHERE productId = 1880 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 745 ;
UPDATE product SET productName = 'ليجن t rكيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '400.00', productSellAllPrice = '400.00', productSellUnitPrice = '400.00', productSellHalfPrice = '400.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01880',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '360',meanbuyprice = '400',meanbuyprice_withDiscount = '380' , productbuypricereal = '400.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='360',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='200',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1880';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 360, meanbuyprice_withDiscount = 380
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 360
                where buybilldetailid = 745;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 1880;
UPDATE storedetail SET  productquantity = '51', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2897';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1880', '1', '51', '0', '116', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '51', '1', '2026-10-12 16:35:51','0','0'); -- id=4864
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 ('01881', '116', '75', '1881', '54.00', '365', '19710.00', '0.00', '', '2026-10-12 17:32:57', '1881','','','0','0','0','0','0',null,'365','19710','0','0','0','0','0','0','0','0','1'); -- id=746
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1881, 0, 0
                    , 328.5, 54, 0, 0, 1, '2026-10-12 17:32:57')
                ON DUPLICATE KEY UPDATE buyprice = 328.5,
                        buyQuantity =buyQuantity+54, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 17:32:57' ; -- id=959
UPDATE product SET  productBuyPrice = "365" WHERE productId = 1881 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 746 ;
UPDATE product SET productName = 'انترلوك شروال كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '365.00', productSellAllPrice = '365.00', productSellUnitPrice = '365.00', productSellHalfPrice = '365.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01881',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '365',lastbuyprice_withDiscount = '328.5',meanbuyprice = '365',meanbuyprice_withDiscount = '346.75' , productbuypricereal = '365.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='328.5',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='365',meanbuyprice_withTax='182.5',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='328.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 = '1881';
UPDATE buybilldetail SET  lastbuyprice = 365 , meanbuyprice = 365, lastbuyprice_withDiscount = 328.5, meanbuyprice_withDiscount = 346.75
        , lastbuyprice_withTax = 365, meanbuyprice_withTax = 182.5, lastbuyprice_withDiscountAndTax = 328.5
                where buybilldetailid = 746;
UPDATE productunit SET proUnitBuyPrice  = 365 * productnumber WHERE productid = 1881;
UPDATE storedetail SET  productquantity = '54', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2898';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1881', '1', '54', '0', '116', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '54', '1', '2026-10-12 16:35:51','0','0'); -- id=4865
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 ('01882', '116', '75', '1882', '33.00', '370', '12210.00', '0.00', '', '2026-10-12 17:32:57', '1882','','','0','0','0','0','0',null,'370','12210','0','0','0','0','0','0','0','0','1'); -- id=747
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 16:35:51', 1, 1882, 0, 0
                    , 333, 33, 0, 0, 1, '2026-10-12 17:32:57')
                ON DUPLICATE KEY UPDATE buyprice = 333,
                        buyQuantity =buyQuantity+33, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 17:32:57' ; -- id=960
UPDATE product SET  productBuyPrice = "370" WHERE productId = 1882 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 747 ;
UPDATE product SET productName = 'جبردين كبسوله كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '370.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01882',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '333',meanbuyprice = '370',meanbuyprice_withDiscount = '351.5' , productbuypricereal = '370.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='333',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='185',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='333',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1882';
UPDATE buybilldetail SET  lastbuyprice = 370 , meanbuyprice = 370, lastbuyprice_withDiscount = 333, meanbuyprice_withDiscount = 351.5
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 185, lastbuyprice_withDiscountAndTax = 333
                where buybilldetailid = 747;
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 1882;
UPDATE storedetail SET  productquantity = '33', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2899';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1882', '1', '33', '0', '116', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '33', '1', '2026-10-12 16:35:51','0','0'); -- id=4866
DELETE FROM productserial WHERE billid = 115
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '-22732',suppliercurrentDebtInCurrency= '-22732' , userid = '1', supplierdate = '2026-10-12 17:32:57'   WHERE supplierid = '13';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('13', '-117475.00', '94743', '0', 'اضافة فاتورة مشتريات', '116', '-22732', '2026-10-12 17:32:57', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','94743','1','-117475','94743','-22732','0',''); -- id=395
UPDATE dailyentry SET totalcreditor = '94743.00', totaldebtor = '94743.00', thedate = '2026-10-12', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-12 16:40:17', entryComment = 'اضافة فاتورة مشتريات رقم 115', fromFlag = '1',related='0',isopeningentry='0',operationId='115',operationDetailLink='buyBillController.php?do=details&id=115' WHERE id = '2142';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '94743.00', '94743.00', '2026-10-12', '1', '0', '2142', '2026-10-12 17:32:57','تم عكس القيد رقم 2142 ','1','0','0','0','0',''); -- id=2151
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2151', '382', '94743.00', '','0'); -- id=2153
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20393622.03', 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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2151', '640', '94743.00', '','0'); -- id=2195
UPDATE accountstree SET name = 'كميت اكس', customName = 'كميت اكس', customNameEn = 'كميت اكس', nameEn = 'كميت اكس', parent = '81', accountNature = '1', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 16:36:50' WHERE id = '640';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '94743', '94743', '2026-10-12', '1', '0', '0', '2026-10-12 17:32:57','اضافة فاتورة مشتريات رقم 116','1','0',null,'0','116','buyBillController.php?do=details&id=116'); -- id=2152
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2152', '382', '94743', '','0'); -- id=2196
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20488365.03', 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 ('2152', '432', '94743', '','0'); -- id=2154
UPDATE accountstree SET name = 'كيميت اكس - مورد', customName = 'كيميت اكس - مورد', customNameEn = 'كيميت اكس - مورد', nameEn = 'كيميت اكس - مورد', parent = '81', accountNature = '1', theValue = '-254163', 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 = '432';
update buybill set dailyentryid='2152,0' where buybillid=116;
UPDATE product SET overAllAveragePrice = 324 WHERE productId = 1877;UPDATE product SET overAllAveragePrice = 333 WHERE productId = 1878;UPDATE product SET overAllAveragePrice = 351 WHERE productId = 1879;UPDATE product SET overAllAveragePrice = 360 WHERE productId = 1880;UPDATE product SET overAllAveragePrice = 328.5 WHERE productId = 1881;UPDATE product SET overAllAveragePrice = 333 WHERE productId = 1882;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:02:57";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:32:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 17:32:57', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=116'); -- id=7884
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:03:19";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:33:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 17:33:19', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7885
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:03:25";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:33:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 17:33:25', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7886
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:06:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:36:45", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 17:36:45', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7887
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:07:21";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:37:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-12 17:37:21', '1', 'details', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=details&id=4'); -- id=7888
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:07:40";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:37:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 17:37:40', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7889
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:10:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:40:07", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:40:07', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7890
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:13:39";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:43:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:43:39', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7891
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:20:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:50:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:50:03', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7892

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accf21b3f09b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 17:50:03', '06accf21b3f09b', '1', '0.00', '0', '0', '1', '2160.00', '2160', '2160', '0', '1', '2026-10-12 17:50:03', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2160','0','','0','0','2160','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=450
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','اضافة فاتورة مبيعات','450', '0', '2026-10-12 17:50:03', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2160', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 17:50:03','0','0','',''); -- id=582
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 70;
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','01378', '450', '94', '1378', '6', '360', '2160', '0', '', '0', '2026-10-12 17:50:03', '1378', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','70-6,','1','1','0','0','360','2160','0','','0','0.00','0','0','0','0'); -- id=1584
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 = 1584;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1378, '2026-10-12', 2160, 1920, 1920
                    , 1920, 1920, 1920, 1920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2160, 1920, 1920
                    , 1920, 1920, 1920, 1920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '582', userid = '2', storedetaildate = '2026-10-12 17:50:03' WHERE storedetailid = '1378';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1378', '1', '6', '1', '450', 'اضافة فاتورة مبيعات', 'sellbillController.php', '588', '582', '2', '2026-10-12 17:50:03','0','0'); -- id=4867
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2573895',  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 ('2571735','2160', '0', '2', 'اضافة فاتورة مبيعات', '450', '2573895', '2026-10-12 17:50:03', '2',  'sellbillController.php','1','','0'); -- id=555
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2160', '2160', '2026-10-12', '2', '0', '0', '2026-10-12 17:50:03','اضافة فاتورة مبيعات رقم 450','1','0',null,'0','450','sellbillController.php?do=showDetail&sellbillid=450'); -- id=2153
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2153', '419', '2160', '','0'); -- id=2197
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2573895', 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 ('2153', '143', '2160', '','0'); -- id=2155
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4451595', 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 ( '1920', '1920', '2026-10-12', '2', '0', '0', '2026-10-12 17:50:03','اضافة فاتورة مبيعات رقم 450 - صرف البضاعة من المخزن','1','0',null,'0','450','sellbillController.php?do=showDetail&sellbillid=450'); -- id=2154
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2154', '402', '1920', '','0'); -- id=2198
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4157818.67', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2154', '382', '1920', '','0'); -- id=2156
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20486445.03', 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='2153,0,2154' where sellbillid=450;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2160, 1920, 1920
                    , 1920, 1920, 1920, 1920
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2160, 1920, 1920
                    , 1920, 1920, 1920, 1920
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1920
                        , returnSellVal = returnSellVal+0, 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, 2160, 1920, 1920
                    , 1920, 1920, 1920, 1920, 1920, 1920)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2160, netSellCostBuyPrice = netSellCostBuyPrice+1920
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1920
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1920
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1920
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1920
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1920
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1920
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1920;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accf21b3f09b and sellbillId = 450 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:20:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:50:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:50:03', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7893
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:20:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:50:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 17:50:28', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7894
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:20:30";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:50:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 17:50:30', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php'); -- id=7895
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:21:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:51:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 17:51:17', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=add'); -- id=7896
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 ('التوامان - مورد', '', '', '-3573', 'مرحل من السيستم القديم', '0', '1', '2026-10-12 17:51:17', '0', '', '','0','0','','','','','','','','','','0','0','1','-3573','0','0'); -- id=159
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 ('159', '0', '-3573', '0', 'إضافة مورد جديد', '159', '-3573', '2026-10-12 17:51:17', '1', 'supplierController.php', '', '0','', '0','1','1','-3573','1','0','-3573','-3573','0',''); -- id=396
UPDATE client SET clientname = '', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '', clientdetails = '', conditions = null, clientdate = '', userid = null  , clientareaid = null  ,clientcode = '',dailyentryid = null , rondomtxt = '',clientStoreIds = '', obygyPatientId = '0' , debtLimit='0' , typeclientid='',priceTypeId='0',lastEditUser = '0',card_number = '0',file_faida = '',specialDiscount = '0',specialDiscountVal = '0',file = '',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '159',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='0',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='0',datecustomeraccount='',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='' WHERE clientid = null;
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('التوامان - مورد', 'التوامان - مورد', 'التوامان - مورد', 'التوامان - مورد', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-10-12 17:51:17'); -- id=642
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '-3573', '-3573', '2026-10-12', '1', '0', '0', '2026-10-12 17:51:17','إضافة مورد  ( التوامان - مورد ) ','1','0','0','0','159','supplierController.php?do=edit&id=159'); -- id=2155
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2155', '121', '-3573', '','0'); -- id=2199
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '10474894.65', 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';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2155', '642', '-3573', '','0'); -- id=2157
UPDATE accountstree SET name = 'التوامان - مورد', customName = 'التوامان - مورد', customNameEn = 'التوامان - مورد', nameEn = 'التوامان - مورد', parent = '81', accountNature = '1', theValue = '-3573', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 17:51:17' WHERE id = '642';
COMMIT;
UPDATE supplier SET suppliername = 'التوامان - مورد', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '-3573.00', supplierdetails = 'مرحل من السيستم القديم', conditions = '0', userid = '1', supplierdate = '2026-10-12', dailyentryid = '2155', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='642',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='-3573',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '159';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:21:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:51:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 17:51:17', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=sucess'); -- id=7897
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:21:19";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:51:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 17:51:19', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7898
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:21:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:51:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 17:51:28', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7899
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:22:11";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:52:11", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:52:11', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7900

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accf147e7899
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 17:52:11', '06accf147e7899', '1', '0.00', '0', '0', '1', '4425.00', '4425', '4425', '0', '1', '2026-10-12 17:52:11', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','4425','0','','0','0','4425','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=451
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','451', '0', '2026-10-12 17:52:11', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4425', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 17:52:11','0','0','',''); -- id=583
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 950;
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','01861', '451', '108', '1861', '3', '625', '1875', '0', '', '0', '2026-10-12 17:52:11', '1861', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','950-3,','1','1','0','0','625','1875','0','','0','0.00','0','0','0','0'); -- id=1585
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 = 1585;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1861, '2026-10-12', 1875, 1800, 1800
                    , 1800, 1800, 1800, 1800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1800, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1875, sellCostBuyPrice =sellCostBuyPrice+1800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1800
                            , 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+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-10-12', 1875, 1800, 1800
                    , 1800, 1800, 1800, 1800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1800, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1875, sellCostBuyPrice =sellCostBuyPrice+1800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1800
                            , 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 = '57', userid = '6', storedetaildate = '2026-10-12 17:52:11' WHERE storedetailid = '2878';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1861', '1', '3', '1', '451', 'اضافة فاتورة مبيعات', 'sellbillController.php', '60', '57', '6', '2026-10-12 17:52:11','0','0'); -- id=4868
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 561;
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 ('800','01698', '451', '130', '1698', '3', '850', '2550', '0', '', '0', '2026-10-12 17:52:11', '1698', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','561-3,','1','1','0','0','850','2550','0','','0','0.00','0','0','0','0'); -- id=1586
UPDATE sellbilldetail SET  lastbuyprice = 800.00 , meanbuyprice = 800.00, lastbuyprice_withDiscount = 800.00, meanbuyprice_withDiscount = 800.00
        , lastbuyprice_withTax = 800, meanbuyprice_withTax = 800, lastbuyprice_withDiscountAndTax = 800
                where sellbilldetailid = 1586;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1698, '2026-10-12', 2550, 2400, 2400
                    , 2400, 2400, 2400, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2550, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2550, 2400, 2400
                    , 2400, 2400, 2400, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2550, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-12 17:52:11' WHERE storedetailid = '2710';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1698', '1', '3', '1', '451', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '27', '6', '2026-10-12 17:52:11','0','0'); -- id=4869
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '168865',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('164440','4425', '0', '4', 'اضافة فاتورة مبيعات', '451', '168865', '2026-10-12 17:52:11', '6',  'sellbillController.php','1','','0'); -- id=556
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4425', '4425', '2026-10-12', '6', '0', '0', '2026-10-12 17:52:11','اضافة فاتورة مبيعات رقم 451','1','0',null,'0','451','sellbillController.php?do=showDetail&sellbillid=451'); -- id=2156
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2156', '568', '4425', '','0'); -- id=2200
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '168865', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2156', '143', '4425', '','0'); -- id=2158
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4456020', 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 ( '4200', '4200', '2026-10-12', '6', '0', '0', '2026-10-12 17:52:11','اضافة فاتورة مبيعات رقم 451 - صرف البضاعة من المخزن','1','0',null,'0','451','sellbillController.php?do=showDetail&sellbillid=451'); -- id=2157
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2157', '402', '4200', '','0'); -- id=2201
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4162018.67', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2157', '382', '4200', '','0'); -- id=2159
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20482245.03', 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='2156,0,2157' where sellbillid=451;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 4425, 4200, 4200
                    , 4200, 4200, 4200, 4200
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4200, 4200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4425, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 4425, 4200, 4200
                    , 4200, 4200, 4200, 4200
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4200, 4200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4425, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4200
                        , returnSellVal = returnSellVal+0, 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, 4425, 4200, 4200
                    , 4200, 4200, 4200, 4200, 4200, 4200)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4425, netSellCostBuyPrice = netSellCostBuyPrice+4200
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4200
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4200
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4200
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4200
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4200
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4200
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4200;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accf147e7899 and sellbillId = 451 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:22:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:52:12", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:52:12', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7901
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:25:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:55:12", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 17:55:12', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7902
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:25:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:55:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:55:33', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7903
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:25:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:55:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:55:38', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7904

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accf39b7986d
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 17:55:38', '06accf39b7986d', '1', '0.00', '0', '0', '1', '2720.00', '2720', '2720', '0', '1', '2026-10-12 17:55:38', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '8' ,'0','','','','','-1','0','0','0','0','0','2720','0','','0','0','2720','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=452
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','اضافة فاتورة مبيعات','452', '0', '2026-10-12 17:55:38', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2720', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 17:55:38','0','0','',''); -- id=584
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 355;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 688;
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 ('276','01467', '452', '104', '1467', '8', '340', '2720', '0', '', '0', '2026-10-12 17:55:38', '1467', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','355-2,688-6,','1','1','0','0','340','2720','0','','0','0.00','0','0','0','0'); -- id=1587
UPDATE sellbilldetail SET  lastbuyprice = 276.00 , meanbuyprice = 276.00, lastbuyprice_withDiscount = 276.00, meanbuyprice_withDiscount = 276.00
        , lastbuyprice_withTax = 276, meanbuyprice_withTax = 276, lastbuyprice_withDiscountAndTax = 276
                where sellbilldetailid = 1587;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1467, '2026-10-12', 2720, 2208, 2208
                    , 2208, 2208, 2208, 2208
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2208, 2208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2720, sellCostBuyPrice =sellCostBuyPrice+2208
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2208, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2208
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2208, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2208
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2208
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2208
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2720, 2208, 2208
                    , 2208, 2208, 2208, 2208
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2208, 2208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2720, sellCostBuyPrice =sellCostBuyPrice+2208
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2208, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2208
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2208, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2208
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2208
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2208
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '580', userid = '2', storedetaildate = '2026-10-12 17:55:38' WHERE storedetailid = '1492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '8', '1', '452', 'اضافة فاتورة مبيعات', 'sellbillController.php', '588', '580', '2', '2026-10-12 17:55:38','0','0'); -- id=4870
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2576615',  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 ('2573895','2720', '0', '2', 'اضافة فاتورة مبيعات', '452', '2576615', '2026-10-12 17:55:38', '2',  'sellbillController.php','1','','0'); -- id=557
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2720', '2720', '2026-10-12', '2', '0', '0', '2026-10-12 17:55:38','اضافة فاتورة مبيعات رقم 452','1','0',null,'0','452','sellbillController.php?do=showDetail&sellbillid=452'); -- id=2158
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2158', '419', '2720', '','0'); -- id=2202
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2576615', 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 ('2158', '143', '2720', '','0'); -- id=2160
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4458740', 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 ( '2208', '2208', '2026-10-12', '2', '0', '0', '2026-10-12 17:55:38','اضافة فاتورة مبيعات رقم 452 - صرف البضاعة من المخزن','1','0',null,'0','452','sellbillController.php?do=showDetail&sellbillid=452'); -- id=2159
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2159', '402', '2208', '','0'); -- id=2203
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4164226.67', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2159', '382', '2208', '','0'); -- id=2161
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20480037.03', 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='2158,0,2159' where sellbillid=452;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2720, 2208, 2208
                    , 2208, 2208, 2208, 2208
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2208, 2208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2720, sellCostBuyPrice =sellCostBuyPrice+2208
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2208, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2208
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2208, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2208
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2208
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2208
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2208
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2720, 2208, 2208
                    , 2208, 2208, 2208, 2208
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2208, 2208, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2720, sellCostBuyPrice =sellCostBuyPrice+2208
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2208, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2208
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2208, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2208
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2208
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2208
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2208
                        , returnSellVal = returnSellVal+0, 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, 2720, 2208, 2208
                    , 2208, 2208, 2208, 2208, 2208, 2208)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2720, netSellCostBuyPrice = netSellCostBuyPrice+2208
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2208
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2208
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2208
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2208
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2208
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2208
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2208;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accf39b7986d and sellbillId = 452 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:25:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:55:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 17:55:38', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7905
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:26:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:56:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 17:56:17', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7906
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:26:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 17:56:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 17:56:22', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7907
UPDATE user SET loginip = "" WHERE userid = 4;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:32:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:02:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 18:02:16', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=7908
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:32:30";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:02:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 18:02:30', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=7909
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:39:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:09:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:09:13', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7910
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:40:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:10:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:10:07', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php'); -- id=7911
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:40:37";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:10:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:10:37', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=add'); -- id=7912
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 ('جاجوار ( الجوكر ) - مورد', '', '', '-8570', '', '0', '1', '2026-10-12 18:10:37', '0', '', '','0','0','','','','','','','','','','0','0','1','-8570','0','0'); -- id=160
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 ('160', '0', '-8570', '0', 'إضافة مورد جديد', '160', '-8570', '2026-10-12 18:10:37', '1', 'supplierController.php', '', '0','', '0','1','1','-8570','1','0','-8570','-8570','0',''); -- id=397
UPDATE client SET clientname = '', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '', clientdetails = '', conditions = null, clientdate = '', userid = null  , clientareaid = null  ,clientcode = '',dailyentryid = null , rondomtxt = '',clientStoreIds = '', obygyPatientId = '0' , debtLimit='0' , typeclientid='',priceTypeId='0',lastEditUser = '0',card_number = '0',file_faida = '',specialDiscount = '0',specialDiscountVal = '0',file = '',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '160',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='0',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='0',datecustomeraccount='',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='' WHERE clientid = null;
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('جاجوار ( الجوكر ) - مورد', 'جاجوار ( الجوكر ) - مورد', 'جاجوار ( الجوكر ) - مورد', 'جاجوار ( الجوكر ) - مورد', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-10-12 18:10:37'); -- id=643
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '-8570', '-8570', '2026-10-12', '1', '0', '0', '2026-10-12 18:10:37','إضافة مورد  ( جاجوار ( الجوكر ) - مورد ) ','1','0','0','0','160','supplierController.php?do=edit&id=160'); -- id=2160
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2160', '121', '-8570', '','0'); -- id=2204
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '10483464.65', 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';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2160', '643', '-8570', '','0'); -- id=2162
UPDATE accountstree SET name = 'جاجوار ( الجوكر ) - مورد', customName = 'جاجوار ( الجوكر ) - مورد', customNameEn = 'جاجوار ( الجوكر ) - مورد', nameEn = 'جاجوار ( الجوكر ) - مورد', parent = '81', accountNature = '1', theValue = '-8570', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 18:10:37' WHERE id = '643';
COMMIT;
UPDATE supplier SET suppliername = 'جاجوار ( الجوكر ) - مورد', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '-8570.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-12', dailyentryid = '2160', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='643',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='-8570',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '160';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:40:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:10:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:10:38', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7913
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:40:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:10:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:10:38', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=sucess'); -- id=7914
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:40:40";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:10:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:10:40', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7915
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:40:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:10:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:10:42', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7916

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accf4ea59ce4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 18:10:42', '06accf4ea59ce4', '1', '0.00', '0', '0', '1', '2400.00', '2400', '2400', '0', '1', '2026-10-12 18:10:42', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2400','0','','0','0','2400','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=453
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','اضافة فاتورة مبيعات','453', '0', '2026-10-12 18:10:42', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2400', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 18:10:42','0','0','',''); -- id=585
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 902;
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 ('372','01855', '453', '144', '1855', '6', '400', '2400', '0', '', '0', '2026-10-12 18:10:42', '1855', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','902-6,','1','1','0','0','400','2400','0','','0','0.00','0','0','0','0'); -- id=1588
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 372.00, meanbuyprice_withDiscount = 372.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 372
                where sellbilldetailid = 1588;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1855, '2026-10-12', 2400, 2400, 2400
                    , 2400, 2232, 2232, 2232
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2232, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2232
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2400, 2400, 2400
                    , 2400, 2232, 2232, 2232
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2232, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2232
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '234', userid = '2', storedetaildate = '2026-10-12 18:10:42' WHERE storedetailid = '2872';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1855', '1', '6', '1', '453', 'اضافة فاتورة مبيعات', 'sellbillController.php', '240', '234', '2', '2026-10-12 18:10:42','0','0'); -- id=4871
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2579015',  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 ('2576615','2400', '0', '2', 'اضافة فاتورة مبيعات', '453', '2579015', '2026-10-12 18:10:42', '2',  'sellbillController.php','1','','0'); -- id=558
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2400', '2400', '2026-10-12', '2', '0', '0', '2026-10-12 18:10:42','اضافة فاتورة مبيعات رقم 453','1','0',null,'0','453','sellbillController.php?do=showDetail&sellbillid=453'); -- id=2161
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2161', '419', '2400', '','0'); -- id=2205
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2579015', 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 ('2161', '143', '2400', '','0'); -- id=2163
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4461140', 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 ( '2232', '2232', '2026-10-12', '2', '0', '0', '2026-10-12 18:10:42','اضافة فاتورة مبيعات رقم 453 - صرف البضاعة من المخزن','1','0',null,'0','453','sellbillController.php?do=showDetail&sellbillid=453'); -- id=2162
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2162', '402', '2232', '','0'); -- id=2206
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4166458.67', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2162', '382', '2232', '','0'); -- id=2164
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20477805.03', 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='2161,0,2162' where sellbillid=453;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2400, 2400, 2400
                    , 2400, 2232, 2232, 2232
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2232, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2232
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2400, 2400, 2400
                    , 2400, 2232, 2232, 2232
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2232, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2232
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2232
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, 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, 2400, 2400, 2400
                    , 2400, 2232, 2232, 2232, 2400, 2400)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2400, netSellCostBuyPrice = netSellCostBuyPrice+2400
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2400
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2400
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2232
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2232
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2232
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2400
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2400;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accf4ea59ce4 and sellbillId = 453 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:40:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:10:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:10:42', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7917
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:41:04";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:11:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:11:04', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7918
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:45:43";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:45:56";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:15:56", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 18:15:56', '4', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7919
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:45:56";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 18:15:56", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 18:15:56', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7920
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:45:59";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:15:59", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:15:59', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7921
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:46:19";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:16:19", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:16:19', '4', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7922

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accf9afe768b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 18:16:19', '06accf9afe768b', '1', '0.00', '0', '0', '1', '1400.00', '1400', '1400', '0', '2', '2026-10-12 18:16:19', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','1400','0','','0','0','1400','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=454
UPDATE client SET  clientdebt = '0', userid = '4' 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','اضافة فاتورة مبيعات','454', '0', '2026-10-12 18:16:19', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1400', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 18:16:19','0','0','',''); -- id=586
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 780;
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 ('252','01779', '454', '99', '1779', '5', '280', '1400', '0', '', '0', '2026-10-12 18:16:19', '1779', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','780-5,','1','1','0','0','280','1400','0','','0','0.00','0','0','0','0'); -- id=1589
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.00, lastbuyprice_withDiscount = 252.00, meanbuyprice_withDiscount = 252.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 252
                where sellbilldetailid = 1589;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1779, '2026-10-12', 1400, 1400, 1400
                    , 1400, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1400, 1400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1400, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , 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+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 (2, '2026-10-12', 1400, 1400, 1400
                    , 1400, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1400, 1400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1400, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , 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 = '4', storedetaildate = '2026-10-12 18:16:19' WHERE storedetailid = '2810';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1779', '2', '5', '1', '454', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '4', '2026-10-12 18:16:19','0','0'); -- id=4872
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '529410',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('528010','1400', '0', '3', 'اضافة فاتورة مبيعات', '454', '529410', '2026-10-12 18:16:19', '4',  'sellbillController.php','1','','0'); -- id=559
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1400', '1400', '2026-10-12', '4', '0', '0', '2026-10-12 18:16:19','اضافة فاتورة مبيعات رقم 454','1','0',null,'0','454','sellbillController.php?do=showDetail&sellbillid=454'); -- id=2163
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2163', '501', '1400', '','0'); -- id=2207
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '529410', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2163', '143', '1400', '','0'); -- id=2165
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4462540', 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 ( '1260', '1260', '2026-10-12', '4', '0', '0', '2026-10-12 18:16:19','اضافة فاتورة مبيعات رقم 454 - صرف البضاعة من المخزن','1','0',null,'0','454','sellbillController.php?do=showDetail&sellbillid=454'); -- id=2164
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2164', '402', '1260', '','0'); -- id=2208
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4167718.67', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2164', '492', '1260', '','0'); -- id=2166
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1121490', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='2163,0,2164' where sellbillid=454;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 1400, 1400, 1400
                    , 1400, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1400, 1400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1400, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , 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;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 1400, 1400, 1400
                    , 1400, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1400, 1400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1400, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1400, 1400, 1400
                    , 1400, 1260, 1260, 1260, 1400, 1400)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1400, netSellCostBuyPrice = netSellCostBuyPrice+1400
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1400
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1400
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1260
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1260
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1260
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1400
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1400;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accf9afe768b and sellbillId = 454 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:46:19";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:16:19", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:16:19', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7923
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:49:23";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:49:27";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:19:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 18:19:27', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7924
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:49:27";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 18:19:27', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7925
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:49:30";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:19:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 18:19:30', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=7926
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:50:19";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:20:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 18:20:19', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=7927
BEGIN;
CALL supplierInUse(131,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('131', '59840.00', '50000', '1', 'ايصال دفع لمورد', '1', '9840', '2026-10-01  1:0:30', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','50000','1','0','0','0','57',''); -- id=398
UPDATE supplierdebtchange SET supplierid = '131', supplierdebtchangebefore = '59840.00', supplierdebtchangeamount = '50000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '9840', supplierdebtchangedate = '2026-10-01  1:0:30', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='59840',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='9840', paySerialNo='57',tagids='' WHERE supplierdebtchangeid = '398';
UPDATE supplier SET  suppliercurrentDebt = '9840',suppliercurrentDebtInCurrency= '9840' , userid = '1', supplierdate = '2026-10-12 18:20:19'   WHERE supplierid = '131';
UPDATE supplier SET  inUse = 0 where supplierid = 131;
UPDATE save SET  savecurrentvalue = '-34526627',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34476627.00','50000', '1', '1', 'ايصال دفع لمورد', '398', '-34526627', '2026-10-12 18:20:19', '1',  'supplierPayedDeptController.php','0','','0'); -- id=560
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50000', '50000', '2026-10-12', '1', '0', '0', '2026-10-12 18:20:19','ايصال دفع لمورد ( نيو لاين ) ','1','0','0','0','398','supplierReportsController.php?do=show&id=398'); -- id=2165
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2165', '614', '50000', '','0'); -- id=2209
UPDATE accountstree SET name = 'نيو لاين', customName = 'نيو لاين', customNameEn = 'نيو لاين', nameEn = 'نيو لاين', parent = '81', accountNature = '1', theValue = '9840', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-08 18:15:59' WHERE id = '614';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2165', '383', '50000', '','0'); -- id=2167
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-34526627', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '131', supplierdebtchangebefore = '59840.00', supplierdebtchangeamount = '50000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '9840.00', supplierdebtchangedate = '2026-10-01 01:00:30', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2165',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='59840',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='9840', paySerialNo='57',tagids='' WHERE supplierdebtchangeid = '398';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:50:19";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:20:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 18:20:19', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=7928
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:50:21";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:20:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 18:20:21', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=7929
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:50:21";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:20:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:20:21', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=7930
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:50:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:20:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 18:20:23', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=7931
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:50:27";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:20:27", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:20:27', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7932
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:51:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:21:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 18:21:03', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=7933
BEGIN;
CALL supplierInUse(132,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('132', '300880.00', '50000', '1', 'ايصال دفع لمورد', '1', '250880', '2026-10-01  1:20:23', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','50000','1','0','0','0','58',''); -- id=399
UPDATE supplierdebtchange SET supplierid = '132', supplierdebtchangebefore = '300880.00', supplierdebtchangeamount = '50000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '250880', supplierdebtchangedate = '2026-10-01  1:20:23', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='300880',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='250880', paySerialNo='58',tagids='' WHERE supplierdebtchangeid = '399';
UPDATE supplier SET  suppliercurrentDebt = '250880',suppliercurrentDebtInCurrency= '250880' , userid = '1', supplierdate = '2026-10-12 18:21:03'   WHERE supplierid = '132';
UPDATE supplier SET  inUse = 0 where supplierid = 132;
UPDATE save SET  savecurrentvalue = '-34576627',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34526627.00','50000', '1', '1', 'ايصال دفع لمورد', '399', '-34576627', '2026-10-12 18:21:03', '1',  'supplierPayedDeptController.php','0','','0'); -- id=561
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50000', '50000', '2026-10-12', '1', '0', '0', '2026-10-12 18:21:03','ايصال دفع لمورد ( رياكشن ) ','1','0','0','0','399','supplierReportsController.php?do=show&id=399'); -- id=2166
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2166', '615', '50000', '','0'); -- id=2210
UPDATE accountstree SET name = 'رياكشن', customName = 'رياكشن', customNameEn = 'رياكشن', nameEn = 'رياكشن', parent = '81', accountNature = '1', theValue = '250880', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-08 18:40:25' WHERE id = '615';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2166', '383', '50000', '','0'); -- id=2168
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-34576627', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '132', supplierdebtchangebefore = '300880.00', supplierdebtchangeamount = '50000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '250880.00', supplierdebtchangedate = '2026-10-01 01:20:23', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2166',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='300880',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='250880', paySerialNo='58',tagids='' WHERE supplierdebtchangeid = '399';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:51:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:21:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 18:21:03', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=7934
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:51:04";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:21:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 18:21:05', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=7935
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:51:05";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:21:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:21:05', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=7936
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:51:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:21:18", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 18:21:18', '4', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7937
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:51:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:21:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:21:42', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7938
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:51:47";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:21:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:21:47', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7939
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:52:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:22:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 18:22:07', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=7940
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:52:24";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:22:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 18:22:24', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=7941
BEGIN;
CALL supplierInUse(66,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('66', '22703.00', '22703', '1', 'ايصال دفع لمورد', '1', '0', '2026-10-12 18:22:07', '1', 'supplierPayedDeptController.php', 'تصفير الحساب', '0','1', '-1','1','1','22703','1','0','0','0','59',''); -- id=400
UPDATE supplierdebtchange SET supplierid = '66', supplierdebtchangebefore = '22703.00', supplierdebtchangeamount = '22703', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '0', supplierdebtchangedate = '2026-10-12 18:22:07', userid = '1', tablename = 'supplierPayedDeptController.php', comment = 'تصفير الحساب', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='22703',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='22703',debtchangamountInSupplierCurrency='22703',debtchangafterInSupplierCurrency='0', paySerialNo='59',tagids='' WHERE supplierdebtchangeid = '400';
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '0' , userid = '1', supplierdate = '2026-10-12 18:22:24'   WHERE supplierid = '66';
UPDATE supplier SET  inUse = 0 where supplierid = 66;
UPDATE save SET  savecurrentvalue = '-34599330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34576627.00','22703', '1', '1', 'ايصال دفع لمورد', '400', '-34599330', '2026-10-12 18:22:24', '1',  'supplierPayedDeptController.php','0','','0'); -- id=562
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '22703', '22703', '2026-10-12', '1', '0', '0', '2026-10-12 18:22:24','ايصال دفع لمورد ( بويكا - مورد ) ','1','0','0','0','400','supplierReportsController.php?do=show&id=400'); -- id=2167
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2167', '485', '22703', '','0'); -- id=2211
UPDATE accountstree SET name = 'بويكا - مورد', customName = 'بويكا - مورد', customNameEn = 'بويكا - مورد', nameEn = 'بويكا - مورد', parent = '81', accountNature = '1', theValue = '-91365', 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 = '485';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2167', '383', '22703', '','0'); -- id=2169
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-34599330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '66', supplierdebtchangebefore = '22703.00', supplierdebtchangeamount = '22703.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '0.00', supplierdebtchangedate = '2026-10-12 18:22:07', userid = '1', tablename = 'supplierPayedDeptController.php', comment = 'تصفير الحساب', dailyentryid = '2167',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='22703',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='22703',debtchangamountInSupplierCurrency='22703',debtchangafterInSupplierCurrency='0', paySerialNo='59',tagids='' WHERE supplierdebtchangeid = '400';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:52:24";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:22:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 18:22:24', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=7942
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:52:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:22:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 18:22:26', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=7943
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:52:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:22:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:22:26', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=7944
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:52:40";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:22:40", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:22:40', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7945
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:52:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:22:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:22:42', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7946
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:52:47";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:22:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:22:47', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7947
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:52:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:22:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:22:49', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7948
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:52:55";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:22:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:22:55', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7949
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:53:01";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:23:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:23:01', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7950
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:53:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:23:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 18:23:13', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=7951
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:53:19";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:23:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 18:23:19', '1', 'editbill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=105'); -- id=7952
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:53:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:23:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 18:23:51', '1', 'update', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=7953
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 105;
UPDATE buybill SET  buybillsysdate = '2026-10-12 18:23:51', userid = '1',delbyuserid = '1', conditions = '1' WHERE buybillid = '105';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 11:08:43', 1, 1839, 0, 0
                    , 450, 90, 0, 0, 1, '2026-10-12 18:23:51')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-90, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 18:23:51' ; -- id=864
UPDATE buybilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 405.00
        , lastbuyprice_withTax = 450.00, meanbuyprice_withTax = 450.00, lastbuyprice_withDiscountAndTax = 405.00
                where buybilldetailid = 671;
UPDATE product SET productName = 'موديل كب شو ستيفو', productDescription = '', productCatId = '141', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01839',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '0',meanbuyprice = '450.00',meanbuyprice_withDiscount = '450' , productbuypricereal = '450.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='405',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='450',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 = '1839';
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 1839;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2854';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1839', '1', '90', '1', '105', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '90', '0', '1', '2026-10-12 11:08:43','0','0'); -- id=4873
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 11:08:43', 1, 1840, 0, 0
                    , 330, 165, 0, 0, 1, '2026-10-12 18:23:51')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-165, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-12 18:23:51' ; -- id=865
UPDATE buybilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 297.00, meanbuyprice_withDiscount = 297.00
        , lastbuyprice_withTax = 330.00, meanbuyprice_withTax = 330.00, lastbuyprice_withDiscountAndTax = 297.00
                where buybilldetailid = 672;
UPDATE product SET productName = 'موديل روند ستيفو', productDescription = '', productCatId = '141', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01840',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '0',meanbuyprice = '330.00',meanbuyprice_withDiscount = '330' , productbuypricereal = '330.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='297',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='330',meanbuyprice_withTax='0',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='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 = '1840';
UPDATE productunit SET proUnitBuyPrice  = 330 * productnumber WHERE productid = 1840;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2855';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1840', '1', '165', '1', '105', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '165', '0', '1', '2026-10-12 11:08:43','0','0'); -- id=4874
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '0' , userid = '1', supplierdate = '2026-10-12 18:23:51'   WHERE supplierid = '152';
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 ('152', '85455.00', '85455.00', '1', 'حذف فاتورة مشتريات - للتعديل', '105', '0', '2026-10-12 11:08:43', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','85455','1','85455','85455','0','0',''); -- id=401
UPDATE productserial SET del = 1
		 WHERE billid = 105;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06acc958b8402b', '2026-10-12 11:08:43', '92', '0.00', '85455', '10', '1', '94950.00', '85455.00', '0.00', '85455', '1', '2026-10-12 18:23:51', '', '1', '0', '', '1', '1','1','105','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=117
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 ('01839', '117', '141', '1839', '90.00', '450', '40500.00', '0.00', '', '2026-10-12 18:23:51', '1839','','','0','0','0','0','0',null,'450','40500','0','0','0','0','0','0','0','0','1'); -- id=748
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 11:08:43', 1, 1839, 0, 0
                    , 405, 90, 0, 0, 1, '2026-10-12 18:23:51')
                ON DUPLICATE KEY UPDATE buyprice = 405,
                        buyQuantity =buyQuantity+90, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 18:23:51' ; -- id=864
UPDATE product SET  productBuyPrice = "450" WHERE productId = 1839 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 748 ;
UPDATE product SET productName = 'موديل كب شو ستيفو', productDescription = '', productCatId = '141', productBuyPrice = '450.00', productSellAllPrice = '450.00', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01839',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '405',meanbuyprice = '450',meanbuyprice_withDiscount = '427.5' , productbuypricereal = '450.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='405',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='450',meanbuyprice_withTax='225',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='405',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1839';
UPDATE buybilldetail SET  lastbuyprice = 450 , meanbuyprice = 450, lastbuyprice_withDiscount = 405, meanbuyprice_withDiscount = 427.5
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 225, lastbuyprice_withDiscountAndTax = 405
                where buybilldetailid = 748;
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 1839;
UPDATE storedetail SET  productquantity = '90', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2854';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1839', '1', '90', '0', '117', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '90', '1', '2026-10-12 11:08:43','0','0'); -- id=4875
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 ('01840', '117', '141', '1840', '165.00', '330', '54450.00', '0.00', '', '2026-10-12 18:23:51', '1840','','','0','0','0','0','0',null,'330','54450','0','0','0','0','0','0','0','0','1'); -- id=749
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 11:08:43', 1, 1840, 0, 0
                    , 297, 165, 0, 0, 1, '2026-10-12 18:23:51')
                ON DUPLICATE KEY UPDATE buyprice = 297,
                        buyQuantity =buyQuantity+165, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 18:23:51' ; -- id=865
UPDATE product SET  productBuyPrice = "330" WHERE productId = 1840 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 749 ;
UPDATE product SET productName = 'موديل روند ستيفو', productDescription = '', productCatId = '141', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01840',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '297',meanbuyprice = '330',meanbuyprice_withDiscount = '313.5' , productbuypricereal = '330.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='297',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='330',meanbuyprice_withTax='165',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='297',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1840';
UPDATE buybilldetail SET  lastbuyprice = 330 , meanbuyprice = 330, lastbuyprice_withDiscount = 297, meanbuyprice_withDiscount = 313.5
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 297
                where buybilldetailid = 749;
UPDATE productunit SET proUnitBuyPrice  = 330 * productnumber WHERE productid = 1840;
UPDATE storedetail SET  productquantity = '165', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2855';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1840', '1', '165', '0', '117', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '165', '1', '2026-10-12 11:08:43','0','0'); -- id=4876
DELETE FROM productserial WHERE billid = 105
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '85455',suppliercurrentDebtInCurrency= '85455' , userid = '1', supplierdate = '2026-10-12 18:23:51'   WHERE supplierid = '92';
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 ('92', '0.00', '85455', '0', 'اضافة فاتورة مشتريات', '117', '85455', '2026-10-12 18:23:51', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','85455','1','0','85455','85455','0',''); -- id=402
UPDATE dailyentry SET totalcreditor = '85455.00', totaldebtor = '85455.00', thedate = '2026-10-12', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-12 11:11:28', entryComment = 'اضافة فاتورة مشتريات رقم 105', fromFlag = '1',related='0',isopeningentry='0',operationId='105',operationDetailLink='buyBillController.php?do=details&id=105' WHERE id = '2062';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '85455.00', '85455.00', '2026-10-12', '1', '0', '2062', '2026-10-12 18:23:51','تم عكس القيد رقم 2062 ','1','0','0','0','0',''); -- id=2168
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2168', '382', '85455.00', '','0'); -- id=2170
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20392350.03', 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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2168', '635', '85455.00', '','0'); -- id=2212
UPDATE accountstree SET name = 'ستيفو', customName = 'ستيفو', customNameEn = 'ستيفو', nameEn = 'ستيفو', parent = '81', accountNature = '1', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 11:10:07' WHERE id = '635';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '85455', '85455', '2026-10-12', '1', '0', '0', '2026-10-12 18:23:51','اضافة فاتورة مشتريات رقم 117','1','0',null,'0','117','buyBillController.php?do=details&id=117'); -- id=2169
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2169', '382', '85455', '','0'); -- id=2213
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20477805.03', 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 ('2169', '575', '85455', '','0'); -- id=2171
UPDATE accountstree SET name = 'ستيفو-موردين', customName = 'ستيفو-موردين', customNameEn = 'ستيفو-موردين', nameEn = 'ستيفو-موردين', parent = '81', accountNature = '1', theValue = '151717', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 19:55:21' WHERE id = '575';
update buybill set dailyentryid='2169,0' where buybillid=117;
UPDATE product SET overAllAveragePrice = 405 WHERE productId = 1839;UPDATE product SET overAllAveragePrice = 297 WHERE productId = 1840;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:53:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:23:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 18:23:51', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=117'); -- id=7954
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:54:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:24:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:24:02', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7955
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:54:11";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:24:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:24:11', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7956
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:54:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:24:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:24:18', '1', 'edit', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=edit&id=152'); -- id=7957
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:54:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:24:22", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:24:22', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7958

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accfabbb5207
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 18:24:22', '06accfabbb5207', '1', '0.00', '0', '0', '1', '5670.00', '5670', '5670', '0', '1', '2026-10-12 18:24:22', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '7' ,'0','','','','','-1','0','0','0','0','0','5670','0','','0','0','5670','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=455
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','455', '0', '2026-10-12 18:24:22', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5670', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 18:24:22','0','0','',''); -- id=587
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 561;
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 ('800','01698', '455', '130', '1698', '3', '850', '2550', '0', '', '0', '2026-10-12 18:24:22', '1698', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','561-3,','1','1','0','0','850','2550','0','','0','0.00','0','0','0','0'); -- id=1590
UPDATE sellbilldetail SET  lastbuyprice = 800.00 , meanbuyprice = 800.00, lastbuyprice_withDiscount = 800.00, meanbuyprice_withDiscount = 800.00
        , lastbuyprice_withTax = 800, meanbuyprice_withTax = 800, lastbuyprice_withDiscountAndTax = 800
                where sellbilldetailid = 1590;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1698, '2026-10-12', 2550, 2400, 2400
                    , 2400, 2400, 2400, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2550, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2550, 2400, 2400
                    , 2400, 2400, 2400, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2550, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-12 18:24:22' WHERE storedetailid = '2710';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1698', '1', '3', '1', '455', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '24', '6', '2026-10-12 18:24:22','0','0'); -- id=4877
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 899;
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','01852', '455', '143', '1852', '4', '780', '3120', '0', '', '0', '2026-10-12 18:24:22', '1852', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','899-4,','1','1','0','0','780','3120','0','','0','0.00','0','0','0','0'); -- id=1591
UPDATE sellbilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 750.00, meanbuyprice_withDiscount = 750.00
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 375, lastbuyprice_withDiscountAndTax = 750
                where sellbilldetailid = 1591;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1852, '2026-10-12', 3120, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 3000, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3120, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3120, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3120, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-12 18:24:22' WHERE storedetailid = '2869';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1852', '1', '4', '1', '455', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '20', '6', '2026-10-12 18:24:22','0','0'); -- id=4878
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '174535',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('168865','5670', '0', '4', 'اضافة فاتورة مبيعات', '455', '174535', '2026-10-12 18:24:22', '6',  'sellbillController.php','1','','0'); -- id=563
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5670', '5670', '2026-10-12', '6', '0', '0', '2026-10-12 18:24:22','اضافة فاتورة مبيعات رقم 455','1','0',null,'0','455','sellbillController.php?do=showDetail&sellbillid=455'); -- id=2170
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2170', '568', '5670', '','0'); -- id=2214
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '174535', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2170', '143', '5670', '','0'); -- id=2172
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4468210', 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 ( '5400', '5400', '2026-10-12', '6', '0', '0', '2026-10-12 18:24:22','اضافة فاتورة مبيعات رقم 455 - صرف البضاعة من المخزن','1','0',null,'0','455','sellbillController.php?do=showDetail&sellbillid=455'); -- id=2171
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2171', '402', '5400', '','0'); -- id=2215
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4173118.67', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2171', '382', '5400', '','0'); -- id=2173
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20472405.03', 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='2170,0,2171' where sellbillid=455;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 5670, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5400, 3900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5670, sellCostBuyPrice =sellCostBuyPrice+5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 5670, 5400, 5400
                    , 5400, 5400, 5400, 5400
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5400, 3900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5670, sellCostBuyPrice =sellCostBuyPrice+5400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3900
                        , returnSellVal = returnSellVal+0, 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, 5670, 5400, 5400
                    , 5400, 5400, 5400, 5400, 5400, 3900)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5670, netSellCostBuyPrice = netSellCostBuyPrice+5400
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+5400
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+5400
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5400
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+5400
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+5400
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+5400
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3900;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accfabbb5207 and sellbillId = 455 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:54:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:24:22", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:24:22', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7959
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:54:29";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:24:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 18:24:29', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7960
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:54:39";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:24:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 18:24:39', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7961
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:55:09";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:25:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 18:25:09', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7962
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:55:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:25:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 18:25:23', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7963
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:56:25";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:26:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 18:26:25', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=7964
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:56:30";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:26:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:26:30', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7965
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:56:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:26:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:26:38', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7966
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:56:46";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:26:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:26:46', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7967
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:56:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:26:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:26:53', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7968
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:56:55";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:26:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:26:55', '1', 'deleteFinaly', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=deleteFinaly&id=152&action=0'); -- id=7969
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:56:57";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:26:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:26:57', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7970
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:57:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:27:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:27:02', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7971
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:57:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:27:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:27:06', '1', 'deleteFinaly', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=deleteFinaly&id=152&action=0'); -- id=7972
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:57:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:27:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:27:08', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7973
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:57:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:27:15", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 18:27:15', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7974
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:57:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:27:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:27:18', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7975
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:57:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:27:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 18:27:26', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=7976
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:57:27";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 18:27:27', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=7977
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:57:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:27:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:27:31', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7978
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:57:37";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:27:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:27:37', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=7979
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:57:38";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:27:38", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 18:27:38', '4', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=7980
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:57:52";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:27:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:27:52', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=editprint&id=152'); -- id=7981
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:58:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:28:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:28:00', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7982
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:58:05";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:28:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:28:05', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7983
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:58:09";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:28:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:28:09', '1', 'deleteFinaly', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=deleteFinaly&id=152&action=0'); -- id=7984
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:58:10";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:28:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:28:10', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=7985
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:58:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:28:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:28:16', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=7986

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accf872af419
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 18:28:16', '06accf872af419', '1', '0.00', '0', '0', '1', '6750.00', '6750', '6750', '0', '1', '2026-10-12 18:28:16', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '15' ,'0','','','','','-1','0','0','0','0','0','6750','0','','0','0','6750','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=456
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','اضافة فاتورة مبيعات','456', '0', '2026-10-12 18:28:16', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '6750', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 18:28:16','0','0','',''); -- id=588
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','08757', '456', '26', '902', '15', '450', '6750', '0', '', '0', '2026-10-12 18:28:16', '902', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','450','6750','0','','0','0.00','0','0','0','0'); -- id=1592
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 = 1592;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (902, '2026-10-12', 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-10-12', 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 = '95', userid = '2', storedetaildate = '2026-10-12 18:28:16' WHERE storedetailid = '902';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('902', '1', '15', '1', '456', 'اضافة فاتورة مبيعات', 'sellbillController.php', '110', '95', '2', '2026-10-12 18:28:16','0','0'); -- id=4879
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2585765',  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 ('2579015','6750', '0', '2', 'اضافة فاتورة مبيعات', '456', '2585765', '2026-10-12 18:28:16', '2',  'sellbillController.php','1','','0'); -- id=564
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6750', '6750', '2026-10-12', '2', '0', '0', '2026-10-12 18:28:16','اضافة فاتورة مبيعات رقم 456','1','0',null,'0','456','sellbillController.php?do=showDetail&sellbillid=456'); -- id=2172
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2172', '419', '6750', '','0'); -- id=2216
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2585765', 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 ('2172', '143', '6750', '','0'); -- id=2174
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4474960', 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 ( '6450', '6450', '2026-10-12', '2', '0', '0', '2026-10-12 18:28:16','اضافة فاتورة مبيعات رقم 456 - صرف البضاعة من المخزن','1','0',null,'0','456','sellbillController.php?do=showDetail&sellbillid=456'); -- id=2173
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2173', '402', '6450', '','0'); -- id=2217
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4179568.67', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2173', '382', '6450', '','0'); -- id=2175
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20465955.03', 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='2172,0,2173' where sellbillid=456;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 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;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 6750, 6450, 6450
                    , 6450, 6450, 6450, 6450, 6450, 6450)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+6750, netSellCostBuyPrice = netSellCostBuyPrice+6450
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6450
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6450
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6450
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6450
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6450
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6450
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+6450;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accf872af419 and sellbillId = 456 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:58:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:28:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:28:16', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7987
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:59:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:29:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-12 18:29:58', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientdebt.php'); -- id=7988
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 14:59:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:29:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientdebt.php', '2026-10-12 18:29:58', '1', 'showallajax', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientdebt.php?do=showallajax'); -- id=7989
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:00:04";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:30:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientController.php', '2026-10-12 18:30:04', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientController.php?do=show'); -- id=7990
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:00:05";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:30:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-12 18:30:05', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=7991
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:00:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:30:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-12 18:30:15', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php?do=show'); -- id=7992
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:00:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:30:20", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:30:20', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7993
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:02:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:32:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:32:17', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=454'); -- id=7994
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:02:24";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:32:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:32:24', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7995
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:08', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=453'); -- id=7996
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:17', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7997
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:21";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:21", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:21', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7998
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:22", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:22', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=7999
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:25";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:25", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:25', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8000
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:25";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:25', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=8001
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:25";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:25", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 18:33:25', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=8002
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:26", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:26', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8003
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:27";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:27", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:27', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8004
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:27";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:27", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 18:33:27', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=8005
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:27";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 18:33:27", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 18:33:27', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=8006
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:28", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 18:33:28', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=8007
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:28", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:28', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8008
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:28", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:28', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8009
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:28", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:28', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8010
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:28", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:28', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8011
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:28", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:28', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8012
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:28", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 18:33:28', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=8013
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:03:39";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:33:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:33:39', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8014
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:04:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:34:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:34:28', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=222'); -- id=8015
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:10:29";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:40:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:40:29', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8016
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:11:40";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:41:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:41:40', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=8017
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:13:24";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:43:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:43:24', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=8018

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accffb49fb7e
-- ----------------------------------------------------------------------------------------------------

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-10-12 18:43:24', '06accffb49fb7e', '1', '0.00', '0', '0', '1', '4000', '4000', '-4000', '0', '1', '2026-10-12 18:43:24', '', '2', '0', 'نقدي','2', '0', '5', '0', 'نقدي', '10', '0', '', '','','','-1','0','0','0','','0','-4000','0','0','0','0','0','0','0','0','-1','0','0','1','','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','1','اضافة فاتورة مردوات مبيعات','14', '0', '2026-10-12 18:43:24', '2', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '4000', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 18:43:24','0','0','',''); -- id=589
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 ('215.00', '03126', '14', '18', '820', '10', '400', '4000', '0', '', '0', '0', '820', '0.00', '0','1','0','','','0','0','0','0','0','0','1','1','','0','0','400','4000','0','','0'); -- id=22
UPDATE returnsellbilldetail SET  lastbuyprice = 215.00 , meanbuyprice = 215.00, lastbuyprice_withDiscount = 215.00, meanbuyprice_withDiscount = 215.00
        , lastbuyprice_withTax = 215, meanbuyprice_withTax = 215, lastbuyprice_withDiscountAndTax = 215
                where returnsellbilldetailid = 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 (820, '2026-10-12', 0, 0, 0
                    , 0, 0, 0, 0
                    , 4000, 2150, 2150, 2150
                    , 2150, 2150, 2150, 0, 10, 0, 0, 2150, 2150)
                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+4000, returnSellCostBuyPrice = returnSellCostBuyPrice+2150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2150
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2150, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2150
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2150
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2150
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2150
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2150
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+10;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 0, 0, 0
                    , 0, 0, 0, 0
                    , 4000, 2150, 2150, 2150
                    , 2150, 2150, 2150, 0, 0, 2150, 2150)
                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+4000, returnSellCostBuyPrice = returnSellCostBuyPrice+2150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2150
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2150, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2150
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2150
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2150
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2150
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2150;
UPDATE storedetail SET  productquantity = '445', userid = '2', storedetaildate = '2026-10-12 18:43:24' WHERE storedetailid = '820';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('820', '1', '10', '0', '14', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '435', '445', '2', '2026-10-12 18:43:24','0','0'); -- id=4880
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2581765',  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 ('2585765','-4000', '1', '2', 'اضافة فاتورة مردوات مبيعات', '14', '2581765', '2026-10-12 18:43:24', '2',  'returnsellbillController.php','1','','0'); -- id=565
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4000', '4000', '2026-10-12', '2', '0', '0', '2026-10-12 18:43:24','اضافة فاتورة مردود مبيعات رقم 14','1','0',null,'0','14','returnsellbillController.php?do=showDetail&returnsellbillid=14'); -- id=2174
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2174', '143', '4000', '','0'); -- id=2218
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4470960', 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 ('2174', '419', '4000', '','0'); -- id=2176
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2581765', 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 ( '2150', '2150', '2026-10-12', '2', '0', '0', '2026-10-12 18:43:24','اضافة فاتورة مردود مبيعات رقم 14 - صرف البضاعة من المخزن','1','0',null,'0','14','returnsellbillController.php?do=showDetail&returnsellbillid=14'); -- id=2175
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2175', '382', '2150', '','0'); -- id=2219
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20468105.03', 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 ('2175', '402', '2150', '','0'); -- id=2177
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4177418.67', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
update returnsellbill set dailyentryid='2174,0,2175' where returnsellbillid=14;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 0, 0, 0
                    , 0, 0, 0, 0
                    , 4000, 2150, 2150, 2150
                    , 2150, 2150, 2150 ,0, 0, 2150, 2150)
                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+4000, returnSellCostBuyPrice = returnSellCostBuyPrice+2150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2150
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2150, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2150
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2150
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2150
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2150
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2150;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 0, 0, 0
                    , 0, 0, 0, 0
                    , 4000, 2150, 2150, 2150
                    , 2150, 2150, 2150 ,0, 0, 2150, 2150)
                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+4000, returnSellCostBuyPrice = returnSellCostBuyPrice+2150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2150
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2150, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2150
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2150
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2150
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2150
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2150;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -4000, -2150, -2150
                    , -2150, -2150, -2150, -2150, -2150, -2150)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-4000, netSellCostBuyPrice = netSellCostBuyPrice+-2150
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-2150
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-2150
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-2150
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-2150
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-2150
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-2150
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-2150;
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:13:25";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:43:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:43:25', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=8019
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:14:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:44:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:44:16', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=8020

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06accff6d916b9
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 18:44:16', '06accff6d916b9', '1', '0.00', '0', '0', '1', '2640.00', '2640', '2640', '0', '1', '2026-10-12 18:44:16', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2640','0','','0','0','2640','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=457
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','اضافة فاتورة مبيعات','457', '0', '2026-10-12 18:44:16', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2640', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 18:44:16','0','0','',''); -- id=590
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 863;
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 ('404.8','01838', '457', '124', '1838', '6', '440', '2640', '0', '', '0', '2026-10-12 18:44:16', '1838', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','863-6,','1','1','0','0','440','2640','0','','0','0.00','0','0','0','0'); -- id=1593
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 404.80, meanbuyprice_withDiscount = 404.80
        , lastbuyprice_withTax = 440, meanbuyprice_withTax = 440, lastbuyprice_withDiscountAndTax = 404.8
                where sellbilldetailid = 1593;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1838, '2026-10-12', 2640, 2640, 2640
                    , 2640, 2428.8, 2428.8, 2428.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2640, 2640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2640, sellCostBuyPrice =sellCostBuyPrice+2640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2428.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2428.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2428.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2640, 2640, 2640
                    , 2640, 2428.8, 2428.8, 2428.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2640, 2640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2640, sellCostBuyPrice =sellCostBuyPrice+2640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2428.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2428.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2428.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 18:44:16' WHERE storedetailid = '2853';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1838', '1', '6', '1', '457', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '24', '2', '2026-10-12 18:44:16','0','0'); -- id=4881
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2584405',  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 ('2581765','2640', '0', '2', 'اضافة فاتورة مبيعات', '457', '2584405', '2026-10-12 18:44:16', '2',  'sellbillController.php','1','','0'); -- id=566
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2640', '2640', '2026-10-12', '2', '0', '0', '2026-10-12 18:44:16','اضافة فاتورة مبيعات رقم 457','1','0',null,'0','457','sellbillController.php?do=showDetail&sellbillid=457'); -- id=2176
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2176', '419', '2640', '','0'); -- id=2220
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2584405', 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 ('2176', '143', '2640', '','0'); -- id=2178
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4473600', 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 ( '2428.8', '2428.8', '2026-10-12', '2', '0', '0', '2026-10-12 18:44:16','اضافة فاتورة مبيعات رقم 457 - صرف البضاعة من المخزن','1','0',null,'0','457','sellbillController.php?do=showDetail&sellbillid=457'); -- id=2177
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2177', '402', '2428.8', '','0'); -- id=2221
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4179847.47', 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 ('2177', '382', '2428.8', '','0'); -- id=2179
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '20465676.23', 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='2176,0,2177' where sellbillid=457;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2640, 2640, 2640
                    , 2640, 2428.8, 2428.8, 2428.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2640, 2640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2640, sellCostBuyPrice =sellCostBuyPrice+2640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2428.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2428.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2428.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2640, 2640, 2640
                    , 2640, 2428.8, 2428.8, 2428.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2640, 2640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2640, sellCostBuyPrice =sellCostBuyPrice+2640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2428.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2428.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2428.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2640
                        , returnSellVal = returnSellVal+0, 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, 2640, 2640, 2640
                    , 2640, 2428.8, 2428.8, 2428.8, 2640, 2640)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2640, netSellCostBuyPrice = netSellCostBuyPrice+2640
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2640
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2640
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2428.8
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2428.8
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2428.8
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2640
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2640;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06accff6d916b9 and sellbillId = 457 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:14:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:44:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:44:16', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8021
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:17:12";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:47:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 18:47:12', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8022
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:21:10";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:51:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 18:51:10', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=8023
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:21:44";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:51:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 18:51:44', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php'); -- id=8024
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:21:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:51:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 18:51:49', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=8025
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:22:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:52:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 18:52:23', '1', 'add2', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=8026
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-10-12','','93', '1','0', '0', '0', '-1', '0', '0', '0', '0','0','','.','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0'); -- id=147
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (147, 1,'2026-10-12 18:52:23',1)
                ON DUPLICATE KEY UPDATE catid = 147, edited = 1, sysdate = '2026-10-12 18:52:23', userid = 1; -- id=159
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '147', '1', '2026-10-12', '1', '0'); -- id=56
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:22:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:52:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 18:52:23', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=8027
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:22:25";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:52:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-12 18:52:25', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=8028
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:22:35";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:52:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 18:52:35', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=8029
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:23:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:53:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:53:17', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=8030
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:23:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:53:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 18:53:22', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=8031
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:23:30";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:53:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 18:53:30', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=8032
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:23:44";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:53:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 18:53:44', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=8033
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:24:52";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:54:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 18:54:52', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=8034
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 ('بوكس فيت 2 جرار','','147','364','395','395','395','2026-10-12','0','1','0','','0','0','0','0','0','364','364','364','364','364','0','8.52','0','0','.','0','0','0','364','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','364','364','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','364','0','0','0','0','0','0','','','0','0','0','0'); -- id=1883
UPDATE product SET productName = 'بوكس فيت 2 جرار', productDescription = '', productCatId = '147', productBuyPrice = '364', productSellAllPrice = '395', productSellUnitPrice = '395', productSellHalfPrice = '395', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01883',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '364',lastbuyprice_withDiscount = '364',meanbuyprice = '364',meanbuyprice_withDiscount = '364' , productbuypricereal = '364' , buypricereal_precentage = '0' , buytotal_precentage = '8.52' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='364',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='364',meanbuyprice_withTax='364',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='364',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1883';
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', '1883', '1.00', '2026-10-12', '1', '0','0188301','395','395','395','364','','0','0','0','0','0','0','0','0','0','0'); -- id=1883
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1883', '1', '0', '1', '2026-10-12'); -- id=2900
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1883', '1', '0', '0', '1883', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4882
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1883, 1,'2026-10-12 18:54:52',1)
                ON DUPLICATE KEY UPDATE productid = 1883, edited = 1, sysdate = '2026-10-12 18:54:52', userid = 1; -- id=2812
UPDATE product SET productName = 'بوكس فيت 2 جرار', productDescription = '', productCatId = '147', productBuyPrice = '364.00', productSellAllPrice = '395.00', productSellUnitPrice = '395.00', productSellHalfPrice = '395.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01883',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '364',lastbuyprice_withDiscount = '364',meanbuyprice = '364',meanbuyprice_withDiscount = '364' , productbuypricereal = '364' , buypricereal_precentage = '0' , buytotal_precentage = '8.52' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='364',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='364',meanbuyprice_withTax='364',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='364',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1883';
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 ('اوفر سايز دوبل قصات','','147','429','460','460','460','2026-10-12','0','1','0','','0','0','0','0','0','429','429','429','429','429','0','7.23','0','0','.','0','0','0','429','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','429','429','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','429','0','0','0','0','0','0','','','0','0','0','0'); -- id=1884
UPDATE product SET productName = 'اوفر سايز دوبل قصات', productDescription = '', productCatId = '147', productBuyPrice = '429', productSellAllPrice = '460', productSellUnitPrice = '460', productSellHalfPrice = '460', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01884',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '429',lastbuyprice_withDiscount = '429',meanbuyprice = '429',meanbuyprice_withDiscount = '429' , productbuypricereal = '429' , buypricereal_precentage = '0' , buytotal_precentage = '7.23' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='429',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='429',meanbuyprice_withTax='429',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='429',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1884';
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', '1884', '1.00', '2026-10-12', '1', '0','0188401','460','460','460','429','','0','0','0','0','0','0','0','0','0','0'); -- id=1884
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1884', '1', '0', '1', '2026-10-12'); -- id=2901
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '0', '0', '1884', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4883
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1884, 1,'2026-10-12 18:54:52',1)
                ON DUPLICATE KEY UPDATE productid = 1884, edited = 1, sysdate = '2026-10-12 18:54:52', userid = 1; -- id=2813
UPDATE product SET productName = 'اوفر سايز دوبل قصات', productDescription = '', productCatId = '147', productBuyPrice = '429.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01884',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '429',lastbuyprice_withDiscount = '429',meanbuyprice = '429',meanbuyprice_withDiscount = '429' , productbuypricereal = '429' , buypricereal_precentage = '0' , buytotal_precentage = '7.23' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='429',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='429',meanbuyprice_withTax='429',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='429',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1884';
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 ('اوفر سايز دوبل تطريز','','147','359','390','390','390','2026-10-12','0','1','0','','0','0','0','0','0','359','359','359','359','359','0','8.64','0','0','.','0','0','0','359','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','359','359','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','359','0','0','0','0','0','0','','','0','0','0','0'); -- id=1885
UPDATE product SET productName = 'اوفر سايز دوبل تطريز', productDescription = '', productCatId = '147', productBuyPrice = '359', productSellAllPrice = '390', productSellUnitPrice = '390', productSellHalfPrice = '390', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01885',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '359',lastbuyprice_withDiscount = '359',meanbuyprice = '359',meanbuyprice_withDiscount = '359' , productbuypricereal = '359' , buypricereal_precentage = '0' , buytotal_precentage = '8.64' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='359',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='359',meanbuyprice_withTax='359',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='359',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1885';
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', '1885', '1.00', '2026-10-12', '1', '0','0188501','390','390','390','359','','0','0','0','0','0','0','0','0','0','0'); -- id=1885
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1885', '1', '0', '1', '2026-10-12'); -- id=2902
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1885', '1', '0', '0', '1885', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4884
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1885, 1,'2026-10-12 18:54:52',1)
                ON DUPLICATE KEY UPDATE productid = 1885, edited = 1, sysdate = '2026-10-12 18:54:52', userid = 1; -- id=2814
UPDATE product SET productName = 'اوفر سايز دوبل تطريز', productDescription = '', productCatId = '147', productBuyPrice = '359.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01885',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '359',lastbuyprice_withDiscount = '359',meanbuyprice = '359',meanbuyprice_withDiscount = '359' , productbuypricereal = '359' , buypricereal_precentage = '0' , buytotal_precentage = '8.64' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='359',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='359',meanbuyprice_withTax='359',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='359',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1885';
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 ('بوكس فيت بيزك','','147','289','320','320','320','2026-10-12','0','1','0','','0','0','0','0','0','289','289','289','289','289','0','10.73','0','0','.','0','0','0','289','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','289','289','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','289','0','0','0','0','0','0','','','0','0','0','0'); -- id=1886
UPDATE product SET productName = 'بوكس فيت بيزك', productDescription = '', productCatId = '147', productBuyPrice = '289', productSellAllPrice = '320', productSellUnitPrice = '320', productSellHalfPrice = '320', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01886',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '289',lastbuyprice_withDiscount = '289',meanbuyprice = '289',meanbuyprice_withDiscount = '289' , productbuypricereal = '289' , buypricereal_precentage = '0' , buytotal_precentage = '10.73' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='289',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='289',meanbuyprice_withTax='289',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='289',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1886';
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', '1886', '1.00', '2026-10-12', '1', '0','0188601','320','320','320','289','','0','0','0','0','0','0','0','0','0','0'); -- id=1886
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1886', '1', '0', '1', '2026-10-12'); -- id=2903
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1886', '1', '0', '0', '1886', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4885
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1886, 1,'2026-10-12 18:54:52',1)
                ON DUPLICATE KEY UPDATE productid = 1886, edited = 1, sysdate = '2026-10-12 18:54:52', userid = 1; -- id=2815
UPDATE product SET productName = 'بوكس فيت بيزك', productDescription = '', productCatId = '147', productBuyPrice = '289.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01886',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '289',lastbuyprice_withDiscount = '289',meanbuyprice = '289',meanbuyprice_withDiscount = '289' , productbuypricereal = '289' , buypricereal_precentage = '0' , buytotal_precentage = '10.73' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='289',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='289',meanbuyprice_withTax='289',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='289',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1886';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:24:54";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:54:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 18:54:54', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=8035
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:24:56";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:54:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 18:54:56', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=8036
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:26:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:56:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 18:56:51', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=8037
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 ('بيج سايز','','147','379','410','410','410','2026-10-12','0','1','0','','0','0','0','0','0','379','379','379','379','379','0','8.18','0','0','.','0','0','0','379','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','379','379','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','379','0','0','0','0','0','0','','','0','0','0','0'); -- id=1887
UPDATE product SET productName = 'بيج سايز', productDescription = '', productCatId = '147', productBuyPrice = '379', productSellAllPrice = '410', productSellUnitPrice = '410', productSellHalfPrice = '410', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01887',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '379',lastbuyprice_withDiscount = '379',meanbuyprice = '379',meanbuyprice_withDiscount = '379' , productbuypricereal = '379' , buypricereal_precentage = '0' , buytotal_precentage = '8.18' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='379',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='379',meanbuyprice_withTax='379',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='379',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1887';
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', '1887', '1.00', '2026-10-12', '1', '0','0188701','410','410','410','379','','0','0','0','0','0','0','0','0','0','0'); -- id=1887
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1887', '1', '0', '1', '2026-10-12'); -- id=2904
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1887', '1', '0', '0', '1887', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4886
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1887, 1,'2026-10-12 18:56:51',1)
                ON DUPLICATE KEY UPDATE productid = 1887, edited = 1, sysdate = '2026-10-12 18:56:51', userid = 1; -- id=2816
UPDATE product SET productName = 'بيج سايز', productDescription = '', productCatId = '147', productBuyPrice = '379.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01887',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '379',lastbuyprice_withDiscount = '379',meanbuyprice = '379',meanbuyprice_withDiscount = '379' , productbuypricereal = '379' , buypricereal_precentage = '0' , buytotal_precentage = '8.18' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='379',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='379',meanbuyprice_withTax='379',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='379',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1887';
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 ('رجالي عادي','','147','269','300','300','300','2026-10-12','0','1','0','','0','0','0','0','0','269','269','269','269','269','0','11.52','0','0','.','0','0','0','269','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','269','269','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','269','0','0','0','0','0','0','','','0','0','0','0'); -- id=1888
UPDATE product SET productName = 'رجالي عادي', productDescription = '', productCatId = '147', productBuyPrice = '269', productSellAllPrice = '300', productSellUnitPrice = '300', productSellHalfPrice = '300', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01888',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '269',lastbuyprice_withDiscount = '269',meanbuyprice = '269',meanbuyprice_withDiscount = '269' , productbuypricereal = '269' , buypricereal_precentage = '0' , buytotal_precentage = '11.52' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='269',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='269',meanbuyprice_withTax='269',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='269',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1888';
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', '1888', '1.00', '2026-10-12', '1', '0','0188801','300','300','300','269','','0','0','0','0','0','0','0','0','0','0'); -- id=1888
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1888', '1', '0', '1', '2026-10-12'); -- id=2905
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1888', '1', '0', '0', '1888', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4887
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1888, 1,'2026-10-12 18:56:51',1)
                ON DUPLICATE KEY UPDATE productid = 1888, edited = 1, sysdate = '2026-10-12 18:56:51', userid = 1; -- id=2817
UPDATE product SET productName = 'رجالي عادي', productDescription = '', productCatId = '147', productBuyPrice = '269.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01888',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '269',lastbuyprice_withDiscount = '269',meanbuyprice = '269',meanbuyprice_withDiscount = '269' , productbuypricereal = '269' , buypricereal_precentage = '0' , buytotal_precentage = '11.52' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='269',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='269',meanbuyprice_withTax='269',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='269',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1888';
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 ('رجالي دوبل زنط','','147','319','350','350','350','2026-10-12','0','1','0','','0','0','0','0','0','319','319','319','319','319','0','9.72','0','0','.','0','0','0','319','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','319','319','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','319','0','0','0','0','0','0','','','0','0','0','0'); -- id=1889
UPDATE product SET productName = 'رجالي دوبل زنط', productDescription = '', productCatId = '147', productBuyPrice = '319', productSellAllPrice = '350', productSellUnitPrice = '350', productSellHalfPrice = '350', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01889',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '319',lastbuyprice_withDiscount = '319',meanbuyprice = '319',meanbuyprice_withDiscount = '319' , productbuypricereal = '319' , buypricereal_precentage = '0' , buytotal_precentage = '9.72' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='319',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='319',meanbuyprice_withTax='319',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='319',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1889';
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', '1889', '1.00', '2026-10-12', '1', '0','0188901','350','350','350','319','','0','0','0','0','0','0','0','0','0','0'); -- id=1889
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1889', '1', '0', '1', '2026-10-12'); -- id=2906
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1889', '1', '0', '0', '1889', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4888
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1889, 1,'2026-10-12 18:56:51',1)
                ON DUPLICATE KEY UPDATE productid = 1889, edited = 1, sysdate = '2026-10-12 18:56:51', userid = 1; -- id=2818
UPDATE product SET productName = 'رجالي دوبل زنط', productDescription = '', productCatId = '147', productBuyPrice = '319.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01889',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '319',lastbuyprice_withDiscount = '319',meanbuyprice = '319',meanbuyprice_withDiscount = '319' , productbuypricereal = '319' , buypricereal_precentage = '0' , buytotal_precentage = '9.72' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='319',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='319',meanbuyprice_withTax='319',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='319',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1889';
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 ('خاص عادي','','147','314','345','345','345','2026-10-12','0','1','0','','0','0','0','0','0','314','314','314','314','314','0','9.87','0','0','.','0','0','0','314','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','314','314','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','314','0','0','0','0','0','0','','','0','0','0','0'); -- id=1890
UPDATE product SET productName = 'خاص عادي', productDescription = '', productCatId = '147', productBuyPrice = '314', productSellAllPrice = '345', productSellUnitPrice = '345', productSellHalfPrice = '345', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01890',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '314',lastbuyprice_withDiscount = '314',meanbuyprice = '314',meanbuyprice_withDiscount = '314' , productbuypricereal = '314' , buypricereal_precentage = '0' , buytotal_precentage = '9.87' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='314',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='314',meanbuyprice_withTax='314',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='314',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1890';
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', '1890', '1.00', '2026-10-12', '1', '0','0189001','345','345','345','314','','0','0','0','0','0','0','0','0','0','0'); -- id=1890
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1890', '1', '0', '1', '2026-10-12'); -- id=2907
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1890', '1', '0', '0', '1890', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4889
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1890, 1,'2026-10-12 18:56:51',1)
                ON DUPLICATE KEY UPDATE productid = 1890, edited = 1, sysdate = '2026-10-12 18:56:51', userid = 1; -- id=2819
UPDATE product SET productName = 'خاص عادي', productDescription = '', productCatId = '147', productBuyPrice = '314.00', productSellAllPrice = '345.00', productSellUnitPrice = '345.00', productSellHalfPrice = '345.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01890',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '314',lastbuyprice_withDiscount = '314',meanbuyprice = '314',meanbuyprice_withDiscount = '314' , productbuypricereal = '314' , buypricereal_precentage = '0' , buytotal_precentage = '9.87' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='314',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='314',meanbuyprice_withTax='314',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='314',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1890';
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 ('خاص دوبل زونط','','147','364','395','395','395','2026-10-12','0','1','0','','0','0','0','0','0','364','364','364','364','364','0','8.52','0','0','.','0','0','0','364','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','364','364','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','364','0','0','0','0','0','0','','','0','0','0','0'); -- id=1891
UPDATE product SET productName = 'خاص دوبل زونط', productDescription = '', productCatId = '147', productBuyPrice = '364', productSellAllPrice = '395', productSellUnitPrice = '395', productSellHalfPrice = '395', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01891',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '364',lastbuyprice_withDiscount = '364',meanbuyprice = '364',meanbuyprice_withDiscount = '364' , productbuypricereal = '364' , buypricereal_precentage = '0' , buytotal_precentage = '8.52' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='364',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='364',meanbuyprice_withTax='364',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='364',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1891';
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', '1891', '1.00', '2026-10-12', '1', '0','0189101','395','395','395','364','','0','0','0','0','0','0','0','0','0','0'); -- id=1891
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1891', '1', '0', '1', '2026-10-12'); -- id=2908
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1891', '1', '0', '0', '1891', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4890
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1891, 1,'2026-10-12 18:56:51',1)
                ON DUPLICATE KEY UPDATE productid = 1891, edited = 1, sysdate = '2026-10-12 18:56:51', userid = 1; -- id=2820
UPDATE product SET productName = 'خاص دوبل زونط', productDescription = '', productCatId = '147', productBuyPrice = '364.00', productSellAllPrice = '395.00', productSellUnitPrice = '395.00', productSellHalfPrice = '395.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01891',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '364',lastbuyprice_withDiscount = '364',meanbuyprice = '364',meanbuyprice_withDiscount = '364' , productbuypricereal = '364' , buypricereal_precentage = '0' , buytotal_precentage = '8.52' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='364',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='364',meanbuyprice_withTax='364',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='364',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1891';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:26:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:56:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 18:56:53', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=8038
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:26:54";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 18:56:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 18:56:54', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=8039
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-10-12 18:57:07', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=161
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 ('161', '0', '', '0', 'إضافة مورد جديد', '161', '', '2026-10-12 18:57:07', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=403
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-10-12 18:57:07'); -- id=644
UPDATE supplier SET suppliername = 'الالماني', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-12', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='644',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '161';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:30:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:00:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 19:00:08', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=8040
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 ('06acd034670312', '2026-10-12 18:56:54', '161', '0.00', '858325', '0', '0', '858325.00',  '858325.00', '0', '858325', '1', '2026-10-12 19:00:08', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=118
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 ('01883', '118', '147', '1883', '171', '364', '62244.00', '0', '', '2026-10-12 19:00:08', '1883','','','0','0','0','0','0',null,'364','62244','0','0','0','0','0','0','0','0','1'); -- id=750
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 18:56:54', 1, 1883, 0, 0
                    , 364, 171, 0, 0, 1, '2026-10-12 19:00:08')
                ON DUPLICATE KEY UPDATE buyprice = 364,
                        buyQuantity =buyQuantity+171, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 19:00:08' ; -- id=977
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1883', '364', '171', '0', 'buyBillController.php', '750', '', '0', '0'); -- id=579
UPDATE product SET  productBuyPrice = "364" WHERE productId = 1883 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 750 ;
UPDATE product SET productName = 'بوكس فيت 2 جرار', productDescription = '', productCatId = '147', productBuyPrice = '364.00', productSellAllPrice = '395.00', productSellUnitPrice = '395.00', productSellHalfPrice = '395.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01883',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '364',lastbuyprice_withDiscount = '364',meanbuyprice = '364',meanbuyprice_withDiscount = '364' , productbuypricereal = '364.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='364',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='364',meanbuyprice_withTax='364',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='364',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1883';
UPDATE buybilldetail SET  lastbuyprice = 364 , meanbuyprice = 364, lastbuyprice_withDiscount = 364, meanbuyprice_withDiscount = 364
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where buybilldetailid = 750;
UPDATE productunit SET proUnitBuyPrice  = 364 * productnumber WHERE productid = 1883;
UPDATE storedetail SET  productquantity = '171', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2900';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1883', '1', '171', '0', '118', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '171', '1', '2026-10-12 18:56:54','0','0'); -- id=4891
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 ('01884', '118', '147', '1884', '292', '429', '125268.00', '0', '', '2026-10-12 19:00:08', '1884','','','0','0','0','0','0',null,'429','125268','0','0','0','0','0','0','0','0','1'); -- id=751
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 18:56:54', 1, 1884, 0, 0
                    , 429, 292, 0, 0, 1, '2026-10-12 19:00:08')
                ON DUPLICATE KEY UPDATE buyprice = 429,
                        buyQuantity =buyQuantity+292, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 19:00:08' ; -- id=978
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1884', '429', '292', '0', 'buyBillController.php', '751', '', '0', '0'); -- id=580
UPDATE product SET  productBuyPrice = "429" WHERE productId = 1884 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 751 ;
UPDATE product SET productName = 'اوفر سايز دوبل قصات', productDescription = '', productCatId = '147', productBuyPrice = '429.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01884',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '429',lastbuyprice_withDiscount = '429',meanbuyprice = '429',meanbuyprice_withDiscount = '429' , productbuypricereal = '429.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.23' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='429',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='429',meanbuyprice_withTax='429',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='429',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1884';
UPDATE buybilldetail SET  lastbuyprice = 429 , meanbuyprice = 429, lastbuyprice_withDiscount = 429, meanbuyprice_withDiscount = 429
        , lastbuyprice_withTax = 429, meanbuyprice_withTax = 429, lastbuyprice_withDiscountAndTax = 429
                where buybilldetailid = 751;
UPDATE productunit SET proUnitBuyPrice  = 429 * productnumber WHERE productid = 1884;
UPDATE storedetail SET  productquantity = '292', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '292', '0', '118', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '292', '1', '2026-10-12 18:56:54','0','0'); -- id=4892
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 ('01885', '118', '147', '1885', '37', '359', '13283.00', '0', '', '2026-10-12 19:00:08', '1885','','','0','0','0','0','0',null,'359','13283','0','0','0','0','0','0','0','0','1'); -- id=752
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 18:56:54', 1, 1885, 0, 0
                    , 359, 37, 0, 0, 1, '2026-10-12 19:00:08')
                ON DUPLICATE KEY UPDATE buyprice = 359,
                        buyQuantity =buyQuantity+37, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 19:00:08' ; -- id=979
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1885', '359', '37', '0', 'buyBillController.php', '752', '', '0', '0'); -- id=581
UPDATE product SET  productBuyPrice = "359" WHERE productId = 1885 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 752 ;
UPDATE product SET productName = 'اوفر سايز دوبل تطريز', productDescription = '', productCatId = '147', productBuyPrice = '359.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01885',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '359',lastbuyprice_withDiscount = '359',meanbuyprice = '359',meanbuyprice_withDiscount = '359' , productbuypricereal = '359.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.64' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='359',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='359',meanbuyprice_withTax='359',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='359',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1885';
UPDATE buybilldetail SET  lastbuyprice = 359 , meanbuyprice = 359, lastbuyprice_withDiscount = 359, meanbuyprice_withDiscount = 359
        , lastbuyprice_withTax = 359, meanbuyprice_withTax = 359, lastbuyprice_withDiscountAndTax = 359
                where buybilldetailid = 752;
UPDATE productunit SET proUnitBuyPrice  = 359 * productnumber WHERE productid = 1885;
UPDATE storedetail SET  productquantity = '37', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2902';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1885', '1', '37', '0', '118', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '37', '1', '2026-10-12 18:56:54','0','0'); -- id=4893
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 ('01886', '118', '147', '1886', '146', '289', '42194.00', '0', '', '2026-10-12 19:00:08', '1886','','','0','0','0','0','0',null,'289','42194','0','0','0','0','0','0','0','0','1'); -- id=753
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 18:56:54', 1, 1886, 0, 0
                    , 289, 146, 0, 0, 1, '2026-10-12 19:00:08')
                ON DUPLICATE KEY UPDATE buyprice = 289,
                        buyQuantity =buyQuantity+146, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 19:00:08' ; -- id=980
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1886', '289', '146', '0', 'buyBillController.php', '753', '', '0', '0'); -- id=582
UPDATE product SET  productBuyPrice = "289" WHERE productId = 1886 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 753 ;
UPDATE product SET productName = 'بوكس فيت بيزك', productDescription = '', productCatId = '147', productBuyPrice = '289.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01886',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '289',lastbuyprice_withDiscount = '289',meanbuyprice = '289',meanbuyprice_withDiscount = '289' , productbuypricereal = '289.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.73' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='289',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='289',meanbuyprice_withTax='289',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='289',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1886';
UPDATE buybilldetail SET  lastbuyprice = 289 , meanbuyprice = 289, lastbuyprice_withDiscount = 289, meanbuyprice_withDiscount = 289
        , lastbuyprice_withTax = 289, meanbuyprice_withTax = 289, lastbuyprice_withDiscountAndTax = 289
                where buybilldetailid = 753;
UPDATE productunit SET proUnitBuyPrice  = 289 * productnumber WHERE productid = 1886;
UPDATE storedetail SET  productquantity = '146', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2903';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1886', '1', '146', '0', '118', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '146', '1', '2026-10-12 18:56:54','0','0'); -- id=4894
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 ('01887', '118', '147', '1887', '372', '379', '140988.00', '0', '', '2026-10-12 19:00:08', '1887','','','0','0','0','0','0',null,'379','140988','0','0','0','0','0','0','0','0','1'); -- id=754
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 18:56:54', 1, 1887, 0, 0
                    , 379, 372, 0, 0, 1, '2026-10-12 19:00:08')
                ON DUPLICATE KEY UPDATE buyprice = 379,
                        buyQuantity =buyQuantity+372, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 19:00:08' ; -- id=981
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1887', '379', '372', '0', 'buyBillController.php', '754', '', '0', '0'); -- id=583
UPDATE product SET  productBuyPrice = "379" WHERE productId = 1887 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 754 ;
UPDATE product SET productName = 'بيج سايز', productDescription = '', productCatId = '147', productBuyPrice = '379.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01887',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '379',lastbuyprice_withDiscount = '379',meanbuyprice = '379',meanbuyprice_withDiscount = '379' , productbuypricereal = '379.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.18' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='379',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='379',meanbuyprice_withTax='379',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='379',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1887';
UPDATE buybilldetail SET  lastbuyprice = 379 , meanbuyprice = 379, lastbuyprice_withDiscount = 379, meanbuyprice_withDiscount = 379
        , lastbuyprice_withTax = 379, meanbuyprice_withTax = 379, lastbuyprice_withDiscountAndTax = 379
                where buybilldetailid = 754;
UPDATE productunit SET proUnitBuyPrice  = 379 * productnumber WHERE productid = 1887;
UPDATE storedetail SET  productquantity = '372', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2904';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1887', '1', '372', '0', '118', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '372', '1', '2026-10-12 18:56:54','0','0'); -- id=4895
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 ('01888', '118', '147', '1888', '420', '269', '112980.00', '0', '', '2026-10-12 19:00:08', '1888','','','0','0','0','0','0',null,'269','112980','0','0','0','0','0','0','0','0','1'); -- id=755
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 18:56:54', 1, 1888, 0, 0
                    , 269, 420, 0, 0, 1, '2026-10-12 19:00:08')
                ON DUPLICATE KEY UPDATE buyprice = 269,
                        buyQuantity =buyQuantity+420, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 19:00:08' ; -- id=982
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1888', '269', '420', '0', 'buyBillController.php', '755', '', '0', '0'); -- id=584
UPDATE product SET  productBuyPrice = "269" WHERE productId = 1888 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 755 ;
UPDATE product SET productName = 'رجالي عادي', productDescription = '', productCatId = '147', productBuyPrice = '269.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01888',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '269',lastbuyprice_withDiscount = '269',meanbuyprice = '269',meanbuyprice_withDiscount = '269' , productbuypricereal = '269.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='269',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='269',meanbuyprice_withTax='269',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='269',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1888';
UPDATE buybilldetail SET  lastbuyprice = 269 , meanbuyprice = 269, lastbuyprice_withDiscount = 269, meanbuyprice_withDiscount = 269
        , lastbuyprice_withTax = 269, meanbuyprice_withTax = 269, lastbuyprice_withDiscountAndTax = 269
                where buybilldetailid = 755;
UPDATE productunit SET proUnitBuyPrice  = 269 * productnumber WHERE productid = 1888;
UPDATE storedetail SET  productquantity = '420', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2905';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1888', '1', '420', '0', '118', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '420', '1', '2026-10-12 18:56:54','0','0'); -- id=4896
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 ('01889', '118', '147', '1889', '336', '319', '107184.00', '0', '', '2026-10-12 19:00:08', '1889','','','0','0','0','0','0',null,'319','107184','0','0','0','0','0','0','0','0','1'); -- id=756
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 18:56:54', 1, 1889, 0, 0
                    , 319, 336, 0, 0, 1, '2026-10-12 19:00:08')
                ON DUPLICATE KEY UPDATE buyprice = 319,
                        buyQuantity =buyQuantity+336, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 19:00:08' ; -- id=983
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1889', '319', '336', '0', 'buyBillController.php', '756', '', '0', '0'); -- id=585
UPDATE product SET  productBuyPrice = "319" WHERE productId = 1889 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 756 ;
UPDATE product SET productName = 'رجالي دوبل زنط', productDescription = '', productCatId = '147', productBuyPrice = '319.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '350.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01889',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '319',lastbuyprice_withDiscount = '319',meanbuyprice = '319',meanbuyprice_withDiscount = '319' , productbuypricereal = '319.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.72' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='319',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='319',meanbuyprice_withTax='319',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='319',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1889';
UPDATE buybilldetail SET  lastbuyprice = 319 , meanbuyprice = 319, lastbuyprice_withDiscount = 319, meanbuyprice_withDiscount = 319
        , lastbuyprice_withTax = 319, meanbuyprice_withTax = 319, lastbuyprice_withDiscountAndTax = 319
                where buybilldetailid = 756;
UPDATE productunit SET proUnitBuyPrice  = 319 * productnumber WHERE productid = 1889;
UPDATE storedetail SET  productquantity = '336', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2906';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1889', '1', '336', '0', '118', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '336', '1', '2026-10-12 18:56:54','0','0'); -- id=4897
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 ('01890', '118', '147', '1890', '420', '314', '131880.00', '0', '', '2026-10-12 19:00:08', '1890','','','0','0','0','0','0',null,'314','131880','0','0','0','0','0','0','0','0','1'); -- id=757
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 18:56:54', 1, 1890, 0, 0
                    , 314, 420, 0, 0, 1, '2026-10-12 19:00:08')
                ON DUPLICATE KEY UPDATE buyprice = 314,
                        buyQuantity =buyQuantity+420, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 19:00:08' ; -- id=984
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1890', '314', '420', '0', 'buyBillController.php', '757', '', '0', '0'); -- id=586
UPDATE product SET  productBuyPrice = "314" WHERE productId = 1890 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 757 ;
UPDATE product SET productName = 'خاص عادي', productDescription = '', productCatId = '147', productBuyPrice = '314.00', productSellAllPrice = '345.00', productSellUnitPrice = '345.00', productSellHalfPrice = '345.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01890',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '314',lastbuyprice_withDiscount = '314',meanbuyprice = '314',meanbuyprice_withDiscount = '314' , productbuypricereal = '314.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.87' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='314',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='314',meanbuyprice_withTax='314',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='314',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1890';
UPDATE buybilldetail SET  lastbuyprice = 314 , meanbuyprice = 314, lastbuyprice_withDiscount = 314, meanbuyprice_withDiscount = 314
        , lastbuyprice_withTax = 314, meanbuyprice_withTax = 314, lastbuyprice_withDiscountAndTax = 314
                where buybilldetailid = 757;
UPDATE productunit SET proUnitBuyPrice  = 314 * productnumber WHERE productid = 1890;
UPDATE storedetail SET  productquantity = '420', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2907';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1890', '1', '420', '0', '118', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '420', '1', '2026-10-12 18:56:54','0','0'); -- id=4898
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 ('01891', '118', '147', '1891', '336', '364', '122304.00', '0', '', '2026-10-12 19:00:08', '1891','','','0','0','0','0','0',null,'364','122304','0','0','0','0','0','0','0','0','1'); -- id=758
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 18:56:54', 1, 1891, 0, 0
                    , 364, 336, 0, 0, 1, '2026-10-12 19:00:08')
                ON DUPLICATE KEY UPDATE buyprice = 364,
                        buyQuantity =buyQuantity+336, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 19:00:08' ; -- id=985
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1891', '364', '336', '0', 'buyBillController.php', '758', '', '0', '0'); -- id=587
UPDATE product SET  productBuyPrice = "364" WHERE productId = 1891 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 758 ;
UPDATE product SET productName = 'خاص دوبل زونط', productDescription = '', productCatId = '147', productBuyPrice = '364.00', productSellAllPrice = '395.00', productSellUnitPrice = '395.00', productSellHalfPrice = '395.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01891',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '364',lastbuyprice_withDiscount = '364',meanbuyprice = '364',meanbuyprice_withDiscount = '364' , productbuypricereal = '364.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='364',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='364',meanbuyprice_withTax='364',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='364',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1891';
UPDATE buybilldetail SET  lastbuyprice = 364 , meanbuyprice = 364, lastbuyprice_withDiscount = 364, meanbuyprice_withDiscount = 364
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where buybilldetailid = 758;
UPDATE productunit SET proUnitBuyPrice  = 364 * productnumber WHERE productid = 1891;
UPDATE storedetail SET  productquantity = '336', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2908';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1891', '1', '336', '0', '118', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '336', '1', '2026-10-12 18:56:54','0','0'); -- id=4899
UPDATE supplier SET  suppliercurrentDebt = '858325',suppliercurrentDebtInCurrency= '858325' , userid = '1', supplierdate = '2026-10-12 19:00:08'   WHERE supplierid = '161';
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 ('161', '0.00', '858325', '0', 'اضافة فاتورة مشتريات', '118', '858325', '2026-10-12 18:56:54', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','858325','1','0','858325','858325','0',''); -- id=404
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '858325', '858325', '2026-10-12', '1', '0', '0', '2026-10-12 19:00:08','اضافة فاتورة مشتريات رقم 118','1','0',null,'0','118','buyBillController.php?do=details&id=118'); -- id=2178
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2178', '382', '858325', '','0'); -- id=2222
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '21324001.23', 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 ('2178', '644', '858325', '','0'); -- id=2180
UPDATE accountstree SET name = 'الالماني', customName = 'الالماني', customNameEn = 'الالماني', nameEn = 'الالماني', parent = '81', accountNature = '1', theValue = '858325', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 18:57:07' WHERE id = '644';
update buybill set dailyentryid='2178,0' where buybillid=118;
COMMIT;
UPDATE product SET overAllAveragePrice = 364 WHERE productId = 1883;UPDATE product SET overAllAveragePrice = 429 WHERE productId = 1884;UPDATE product SET overAllAveragePrice = 359 WHERE productId = 1885;UPDATE product SET overAllAveragePrice = 289 WHERE productId = 1886;UPDATE product SET overAllAveragePrice = 379 WHERE productId = 1887;UPDATE product SET overAllAveragePrice = 269 WHERE productId = 1888;UPDATE product SET overAllAveragePrice = 319 WHERE productId = 1889;UPDATE product SET overAllAveragePrice = 314 WHERE productId = 1890;UPDATE product SET overAllAveragePrice = 364 WHERE productId = 1891;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:30:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:00:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 19:00:08', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=118'); -- id=8041
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:30:14";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:00:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 19:00:14', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=118&type=2'); -- id=8042
UPDATE user SET loginip = "" WHERE userid = 4;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:37:52";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:07:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 19:07:52', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=118&type=2'); -- id=8043
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:39:46";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:39:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:09:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 19:09:49', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=8044
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:39:49";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 19:09:49', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=8045
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:45:47";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:15:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 19:15:47', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=8046
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:46:47";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:16:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 19:16:47', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=8047
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 ('موديل 708','','137','1100','1170','1170','1170','2026-10-12','0','1','0','','0','0','0','0','0','1100','1100','1100','1100','1100','0','6.36','0','0','.','0','0','0','1100','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','1100','1100','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','1100','0','0','0','0','0','0','','','0','0','0','0'); -- id=1892
UPDATE product SET productName = 'موديل 708', productDescription = '', productCatId = '137', productBuyPrice = '1100', productSellAllPrice = '1170', productSellUnitPrice = '1170', productSellHalfPrice = '1170', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01892',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1100',lastbuyprice_withDiscount = '1100',meanbuyprice = '1100',meanbuyprice_withDiscount = '1100' , productbuypricereal = '1100' , buypricereal_precentage = '0' , buytotal_precentage = '6.36' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1100',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='1100',meanbuyprice_withTax='1100',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='1100',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1892';
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', '1892', '1.00', '2026-10-12', '1', '0','0189201','1170','1170','1170','1100','','0','0','0','0','0','0','0','0','0','0'); -- id=1892
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1892', '1', '0', '1', '2026-10-12'); -- id=2909
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1892', '1', '0', '0', '1892', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4900
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1892, 1,'2026-10-12 19:16:47',1)
                ON DUPLICATE KEY UPDATE productid = 1892, edited = 1, sysdate = '2026-10-12 19:16:47', userid = 1; -- id=2821
UPDATE product SET productName = 'موديل 708', productDescription = '', productCatId = '137', productBuyPrice = '1100.00', productSellAllPrice = '1170.00', productSellUnitPrice = '1170.00', productSellHalfPrice = '1170.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01892',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1100',lastbuyprice_withDiscount = '1100',meanbuyprice = '1100',meanbuyprice_withDiscount = '1100' , productbuypricereal = '1100' , buypricereal_precentage = '0' , buytotal_precentage = '6.36' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1100',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='1100',meanbuyprice_withTax='1100',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='1100',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1892';
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 ('موديل 925','','137','620','660','660','660','2026-10-12','0','1','0','','0','0','0','0','0','620','620','620','620','620','0','6.45','0','0','.','0','0','0','620','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','620','620','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','620','0','0','0','0','0','0','','','0','0','0','0'); -- id=1893
UPDATE product SET productName = 'موديل 925', productDescription = '', productCatId = '137', productBuyPrice = '620', productSellAllPrice = '660', productSellUnitPrice = '660', productSellHalfPrice = '660', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01893',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '620',lastbuyprice_withDiscount = '620',meanbuyprice = '620',meanbuyprice_withDiscount = '620' , productbuypricereal = '620' , buypricereal_precentage = '0' , buytotal_precentage = '6.45' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='620',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='620',meanbuyprice_withTax='620',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='620',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1893';
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', '1893', '1.00', '2026-10-12', '1', '0','0189301','660','660','660','620','','0','0','0','0','0','0','0','0','0','0'); -- id=1893
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1893', '1', '0', '1', '2026-10-12'); -- id=2910
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1893', '1', '0', '0', '1893', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4901
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1893, 1,'2026-10-12 19:16:47',1)
                ON DUPLICATE KEY UPDATE productid = 1893, edited = 1, sysdate = '2026-10-12 19:16:47', userid = 1; -- id=2822
UPDATE product SET productName = 'موديل 925', productDescription = '', productCatId = '137', productBuyPrice = '620.00', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01893',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '620',lastbuyprice_withDiscount = '620',meanbuyprice = '620',meanbuyprice_withDiscount = '620' , productbuypricereal = '620' , buypricereal_precentage = '0' , buytotal_precentage = '6.45' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='620',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='620',meanbuyprice_withTax='620',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='620',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1893';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:46:48";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:16:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 19:16:48', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=8048
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:46:50";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:16:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 19:16:50', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=8049
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:47:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:17:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 19:17:26', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=8050
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 ('06acd07f29ddb4', '2026-10-12 19:16:50', '132', '250880.00', '292160', '0', '0', '41280.00',  '41280.00', '0', '41280', '1', '2026-10-12 19:17:26', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=119
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 ('01892', '119', '137', '1892', '24', '1100', '26400.00', '0', '', '2026-10-12 19:17:26', '1892','','','0','0','0','0','0',null,'1100','26400','0','0','0','0','0','0','0','0','1'); -- id=759
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 19:16:50', 1, 1892, 0, 0
                    , 1100, 24, 0, 0, 1, '2026-10-12 19:17:26')
                ON DUPLICATE KEY UPDATE buyprice = 1100,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 19:17:26' ; -- id=986
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1892', '1100', '24', '0', 'buyBillController.php', '759', '', '0', '0'); -- id=588
UPDATE product SET  productBuyPrice = "1100" WHERE productId = 1892 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 759 ;
UPDATE product SET productName = 'موديل 708', productDescription = '', productCatId = '137', productBuyPrice = '1100.00', productSellAllPrice = '1170.00', productSellUnitPrice = '1170.00', productSellHalfPrice = '1170.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01892',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '1100',lastbuyprice_withDiscount = '1100',meanbuyprice = '1100',meanbuyprice_withDiscount = '1100' , productbuypricereal = '1100.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.36' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='1100',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='1100',meanbuyprice_withTax='1100',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='1100',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1892';
UPDATE buybilldetail SET  lastbuyprice = 1100 , meanbuyprice = 1100, lastbuyprice_withDiscount = 1100, meanbuyprice_withDiscount = 1100
        , lastbuyprice_withTax = 1100, meanbuyprice_withTax = 1100, lastbuyprice_withDiscountAndTax = 1100
                where buybilldetailid = 759;
UPDATE productunit SET proUnitBuyPrice  = 1100 * productnumber WHERE productid = 1892;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2909';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1892', '1', '24', '0', '119', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 19:16:50','0','0'); -- id=4902
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 ('01893', '119', '137', '1893', '24', '620', '14880.00', '0', '', '2026-10-12 19:17:26', '1893','','','0','0','0','0','0',null,'620','14880','0','0','0','0','0','0','0','0','1'); -- id=760
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 19:16:50', 1, 1893, 0, 0
                    , 620, 24, 0, 0, 1, '2026-10-12 19:17:26')
                ON DUPLICATE KEY UPDATE buyprice = 620,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 19:17:26' ; -- id=987
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1893', '620', '24', '0', 'buyBillController.php', '760', '', '0', '0'); -- id=589
UPDATE product SET  productBuyPrice = "620" WHERE productId = 1893 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 760 ;
UPDATE product SET productName = 'موديل 925', productDescription = '', productCatId = '137', productBuyPrice = '620.00', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01893',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '620',lastbuyprice_withDiscount = '620',meanbuyprice = '620',meanbuyprice_withDiscount = '620' , productbuypricereal = '620.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.45' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='620',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='620',meanbuyprice_withTax='620',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='620',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1893';
UPDATE buybilldetail SET  lastbuyprice = 620 , meanbuyprice = 620, lastbuyprice_withDiscount = 620, meanbuyprice_withDiscount = 620
        , lastbuyprice_withTax = 620, meanbuyprice_withTax = 620, lastbuyprice_withDiscountAndTax = 620
                where buybilldetailid = 760;
UPDATE productunit SET proUnitBuyPrice  = 620 * productnumber WHERE productid = 1893;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2910';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1893', '1', '24', '0', '119', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-12 19:16:50','0','0'); -- id=4903
UPDATE supplier SET  suppliercurrentDebt = '292160',suppliercurrentDebtInCurrency= '292160' , userid = '1', supplierdate = '2026-10-12 19:17:26'   WHERE supplierid = '132';
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 ('132', '250880.00', '41280', '0', 'اضافة فاتورة مشتريات', '119', '292160', '2026-10-12 19:16:50', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','41280','1','250880','41280','292160','0',''); -- id=405
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '41280', '41280', '2026-10-12', '1', '0', '0', '2026-10-12 19:17:26','اضافة فاتورة مشتريات رقم 119','1','0',null,'0','119','buyBillController.php?do=details&id=119'); -- id=2179
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2179', '382', '41280', '','0'); -- id=2223
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '21365281.23', 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 ('2179', '615', '41280', '','0'); -- id=2181
UPDATE accountstree SET name = 'رياكشن', customName = 'رياكشن', customNameEn = 'رياكشن', nameEn = 'رياكشن', parent = '81', accountNature = '1', theValue = '292160', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-08 18:40:25' WHERE id = '615';
update buybill set dailyentryid='2179,0' where buybillid=119;
COMMIT;
UPDATE product SET overAllAveragePrice = 1100 WHERE productId = 1892;UPDATE product SET overAllAveragePrice = 620 WHERE productId = 1893;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:47:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:17:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 19:17:26', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=119'); -- id=8051
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:47:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:17:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 19:17:45', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=119&type=2'); -- id=8052
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:48:32";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:18:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 19:18:32', '1', 'showbarcode', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=8053
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:48:36";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:18:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 19:18:36', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=8054
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:49:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:19:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 19:19:16', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=8055
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 ('موديل 412','','136','630','670','670','670','2026-10-12','0','1','0','','0','0','0','0','0','630','630','630','630','630','0','6.35','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','0','0','0','0','0','-1','0','','630','0','0','0','0','0','0','','','0','0','0','0'); -- id=1894
UPDATE product SET productName = 'موديل 412', productDescription = '', productCatId = '136', productBuyPrice = '630', productSellAllPrice = '670', productSellUnitPrice = '670', productSellHalfPrice = '670', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01894',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 = '6.35' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '1894';
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', '1894', '1.00', '2026-10-12', '1', '0','0189401','670','670','670','630','','0','0','0','0','0','0','0','0','0','0'); -- id=1894
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1894', '1', '0', '1', '2026-10-12'); -- id=2911
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1894', '1', '0', '0', '1894', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-12','0','0'); -- id=4904
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1894, 1,'2026-10-12 19:19:16',1)
                ON DUPLICATE KEY UPDATE productid = 1894, edited = 1, sysdate = '2026-10-12 19:19:16', userid = 1; -- id=2823
UPDATE product SET productName = 'موديل 412', productDescription = '', productCatId = '136', productBuyPrice = '630.00', productSellAllPrice = '670.00', productSellUnitPrice = '670.00', productSellHalfPrice = '670.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01894',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 = '6.35' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '1894';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:49:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:19:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 19:19:18', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=8056
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:49:19";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:19:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 19:19:19', '1', 'bill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=8057
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:49:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:19:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 19:19:49', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=8058
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 ('06acd0887948b5', '2026-10-12 19:19:19', '131', '9840.00', '30000', '0', '0', '20160.00',  '20160.00', '0', '20160', '1', '2026-10-12 19:19:49', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=120
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 ('01894', '120', '136', '1894', '32', '630', '20160.00', '0', '', '2026-10-12 19:19:49', '1894','','','0','0','0','0','0',null,'630','20160','0','0','0','0','0','0','0','0','1'); -- id=761
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-12 19:19:19', 1, 1894, 0, 0
                    , 630, 32, 0, 0, 1, '2026-10-12 19:19:49')
                ON DUPLICATE KEY UPDATE buyprice = 630,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-12 19:19:49' ; -- id=988
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1894', '630', '32', '0', 'buyBillController.php', '761', '', '0', '0'); -- id=590
UPDATE product SET  productBuyPrice = "630" WHERE productId = 1894 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 761 ;
UPDATE product SET productName = 'موديل 412', productDescription = '', productCatId = '136', productBuyPrice = '630.00', productSellAllPrice = '670.00', productSellUnitPrice = '670.00', productSellHalfPrice = '670.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01894',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 = '6.35' , 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='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',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 = '1894';
UPDATE buybilldetail SET  lastbuyprice = 630 , meanbuyprice = 630, lastbuyprice_withDiscount = 630, meanbuyprice_withDiscount = 630
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 630, lastbuyprice_withDiscountAndTax = 630
                where buybilldetailid = 761;
UPDATE productunit SET proUnitBuyPrice  = 630 * productnumber WHERE productid = 1894;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-12' WHERE storedetailid = '2911';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1894', '1', '32', '0', '120', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '32', '1', '2026-10-12 19:19:19','0','0'); -- id=4905
UPDATE supplier SET  suppliercurrentDebt = '30000',suppliercurrentDebtInCurrency= '30000' , userid = '1', supplierdate = '2026-10-12 19:19:49'   WHERE supplierid = '131';
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 ('131', '9840.00', '20160', '0', 'اضافة فاتورة مشتريات', '120', '30000', '2026-10-12 19:19:19', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','20160','1','9840','20160','30000','0',''); -- id=406
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20160', '20160', '2026-10-12', '1', '0', '0', '2026-10-12 19:19:49','اضافة فاتورة مشتريات رقم 120','1','0',null,'0','120','buyBillController.php?do=details&id=120'); -- id=2180
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2180', '382', '20160', '','0'); -- id=2224
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '21385441.23', 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 ('2180', '614', '20160', '','0'); -- id=2182
UPDATE accountstree SET name = 'نيو لاين', customName = 'نيو لاين', customNameEn = 'نيو لاين', nameEn = 'نيو لاين', parent = '81', accountNature = '1', theValue = '30000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-08 18:15:59' WHERE id = '614';
update buybill set dailyentryid='2180,0' where buybillid=120;
COMMIT;
UPDATE product SET overAllAveragePrice = 630 WHERE productId = 1894;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:49:49";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:19:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-12 19:19:49', '1', 'editprint', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=120'); -- id=8059
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:49:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:19:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-12 19:19:53', '1', 'showbarcodebuybill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=120&type=2'); -- id=8060
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:52:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:22:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 19:22:13', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=8061
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:52:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:22:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 19:22:20', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=8062
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:52:24";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:22:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 19:22:24', '1', 'oneSupplier', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=8063
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:58:54";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:28:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 19:28:54', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=8064

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acd005098753
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 19:28:54', '06acd005098753', '1', '0.00', '0', '0', '1', '63815.00', '63815', '63815', '0', '1', '2026-10-12 19:28:54', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '161' ,'0','','','','','-1','0','0','0','0','0','63815','0','','0','0','63815','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=458
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','اضافة فاتورة مبيعات','458', '0', '2026-10-12 19:28:54', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '63815', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 19:28:54','0','0','',''); -- id=591
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 61;
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','09496', '458', '33', '1045', '15', '270', '4050', '0', '', '0', '2026-10-12 19:28:54', '1045', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','61-15,','1','1','0','0','270','4050','0','','0','0.00','0','0','0','0'); -- id=1594
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 = 1594;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1045, '2026-10-12', 4050, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4050, 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+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 4050, 3750, 3750
                    , 3750, 3750, 3750, 3750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3750, 3750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4050, 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 = '85', userid = '2', storedetaildate = '2026-10-12 19:28:54' WHERE storedetailid = '1045';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1045', '1', '15', '1', '458', 'اضافة فاتورة مبيعات', 'sellbillController.php', '100', '85', '2', '2026-10-12 19:28:54','0','0'); -- id=4906
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','09812', '458', '19', '847', '24', '390', '9360', '0', '', '0', '2026-10-12 19:28:54', '847', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','390','9360','0','','0','0.00','0','0','0','0'); -- id=1595
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 = 1595;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (847, '2026-10-12', 9360, 8880, 8880
                    , 8880, 8880, 8880, 8880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 24, 0, 8880, 8880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9360, sellCostBuyPrice =sellCostBuyPrice+8880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+24
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 9360, 8880, 8880
                    , 8880, 8880, 8880, 8880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8880, 8880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9360, sellCostBuyPrice =sellCostBuyPrice+8880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-12 19:28:54' WHERE storedetailid = '847';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('847', '1', '24', '1', '458', 'اضافة فاتورة مبيعات', 'sellbillController.php', '72', '48', '2', '2026-10-12 19:28:54','0','0'); -- id=4907
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','07269', '458', '13', '780', '6', '315', '1890', '0', '', '0', '2026-10-12 19:28:54', '780', '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=1596
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 = 1596;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (780, '2026-10-12', 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-10-12', 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 = '84', userid = '2', storedetaildate = '2026-10-12 19:28:54' WHERE storedetailid = '780';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('780', '1', '6', '1', '458', 'اضافة فاتورة مبيعات', 'sellbillController.php', '90', '84', '2', '2026-10-12 19:28:54','0','0'); -- id=4908
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 828;
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','01826', '458', '24', '1826', '20', '375', '7500', '0', '', '0', '2026-10-12 19:28:54', '1826', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','828-20,','1','1','0','0','375','7500','0','','0','0.00','0','0','0','0'); -- id=1597
UPDATE sellbilldetail SET  lastbuyprice = 375.00 , meanbuyprice = 375.00, lastbuyprice_withDiscount = 345.00, meanbuyprice_withDiscount = 345.00
        , lastbuyprice_withTax = 375, meanbuyprice_withTax = 375, lastbuyprice_withDiscountAndTax = 345
                where sellbilldetailid = 1597;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1826, '2026-10-12', 7500, 7500, 7500
                    , 7500, 6900, 6900, 6900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 7500, 7500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7500, sellCostBuyPrice =sellCostBuyPrice+7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 7500, 7500, 7500
                    , 7500, 6900, 6900, 6900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7500, 7500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7500, sellCostBuyPrice =sellCostBuyPrice+7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '56', userid = '2', storedetaildate = '2026-10-12 19:28:54' WHERE storedetailid = '2840';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1826', '1', '20', '1', '458', 'اضافة فاتورة مبيعات', 'sellbillController.php', '76', '56', '2', '2026-10-12 19:28:54','0','0'); -- id=4909
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 62;
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 ('435','09714', '458', '11', '770', '15', '455', '6825', '0', '', '0', '2026-10-12 19:28:54', '770', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','62-15,','1','1','0','0','455','6825','0','','0','0.00','0','0','0','0'); -- id=1598
UPDATE sellbilldetail SET  lastbuyprice = 435.00 , meanbuyprice = 435.00, lastbuyprice_withDiscount = 435.00, meanbuyprice_withDiscount = 435.00
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 435, lastbuyprice_withDiscountAndTax = 435
                where sellbilldetailid = 1598;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (770, '2026-10-12', 6825, 6525, 6525
                    , 6525, 6525, 6525, 6525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 6525, 6525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6825, sellCostBuyPrice =sellCostBuyPrice+6525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 6825, 6525, 6525
                    , 6525, 6525, 6525, 6525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6525, 6525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6825, sellCostBuyPrice =sellCostBuyPrice+6525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '343', userid = '2', storedetaildate = '2026-10-12 19:28:54' WHERE storedetailid = '770';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('770', '1', '15', '1', '458', 'اضافة فاتورة مبيعات', 'sellbillController.php', '358', '343', '2', '2026-10-12 19:28:54','0','0'); -- id=4910
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','09107', '458', '10', '767', '20', '375', '7500', '0', '', '0', '2026-10-12 19:28:54', '767', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','375','7500','0','','0','0.00','0','0','0','0'); -- id=1599
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 = 1599;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (767, '2026-10-12', 7500, 7100, 7100
                    , 7100, 7100, 7100, 7100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 7100, 7100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7500, sellCostBuyPrice =sellCostBuyPrice+7100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 7500, 7100, 7100
                    , 7100, 7100, 7100, 7100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7100, 7100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7500, sellCostBuyPrice =sellCostBuyPrice+7100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '37', userid = '2', storedetaildate = '2026-10-12 19:28:54' WHERE storedetailid = '767';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('767', '1', '20', '1', '458', 'اضافة فاتورة مبيعات', 'sellbillController.php', '57', '37', '2', '2026-10-12 19:28:54','0','0'); -- id=4911
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','07901', '458', '32', '1019', '10', '380', '3800', '0', '', '0', '2026-10-12 19:28:54', '1019', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','380','3800','0','','0','0.00','0','0','0','0'); -- id=1600
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 = 1600;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1019, '2026-10-12', 3800, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3800, sellCostBuyPrice =sellCostBuyPrice+3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 3800, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3800, sellCostBuyPrice =sellCostBuyPrice+3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '52', userid = '2', storedetaildate = '2026-10-12 19:28:54' WHERE storedetailid = '1019';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1019', '1', '10', '1', '458', 'اضافة فاتورة مبيعات', 'sellbillController.php', '62', '52', '2', '2026-10-12 19:28:54','0','0'); -- id=4912
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 62;
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 ('435','09714', '458', '11', '770', '15', '455', '6825', '0', '', '0', '2026-10-12 19:28:54', '770', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','62-15,','1','1','0','0','455','6825','0','','0','0.00','0','0','0','0'); -- id=1601
UPDATE sellbilldetail SET  lastbuyprice = 435.00 , meanbuyprice = 435.00, lastbuyprice_withDiscount = 435.00, meanbuyprice_withDiscount = 435.00
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 435, lastbuyprice_withDiscountAndTax = 435
                where sellbilldetailid = 1601;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (770, '2026-10-12', 6825, 6525, 6525
                    , 6525, 6525, 6525, 6525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 6525, 6525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6825, sellCostBuyPrice =sellCostBuyPrice+6525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 6825, 6525, 6525
                    , 6525, 6525, 6525, 6525
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6525, 6525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6825, sellCostBuyPrice =sellCostBuyPrice+6525
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6525, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6525
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6525, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6525
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6525
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6525
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '328', userid = '2', storedetaildate = '2026-10-12 19:28:54' WHERE storedetailid = '770';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('770', '1', '15', '1', '458', 'اضافة فاتورة مبيعات', 'sellbillController.php', '343', '328', '2', '2026-10-12 19:28:54','0','0'); -- id=4913
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','07269', '458', '13', '780', '6', '315', '1890', '0', '', '0', '2026-10-12 19:28:54', '780', '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=1602
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 = 1602;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (780, '2026-10-12', 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-10-12', 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 = '78', userid = '2', storedetaildate = '2026-10-12 19:28:54' WHERE storedetailid = '780';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('780', '1', '6', '1', '458', 'اضافة فاتورة مبيعات', 'sellbillController.php', '84', '78', '2', '2026-10-12 19:28:54','0','0'); -- id=4914
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 ('530','09607', '458', '37', '1095', '15', '550', '8250', '0', '', '0', '2026-10-12 19:28:54', '1095', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','550','8250','0','','0','0.00','0','0','0','0'); -- id=1603
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 1603;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1095, '2026-10-12', 8250, 7950, 7950
                    , 7950, 7950, 7950, 7950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 7950, 7950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8250, sellCostBuyPrice =sellCostBuyPrice+7950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 8250, 7950, 7950
                    , 7950, 7950, 7950, 7950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7950, 7950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8250, sellCostBuyPrice =sellCostBuyPrice+7950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 19:28:54' WHERE storedetailid = '1095';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1095', '1', '15', '1', '458', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '0', '2', '2026-10-12 19:28:54','0','0'); -- id=4915
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 295;
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 ('380','01517', '458', '32', '1517', '15', '395', '5925', '0', '', '0', '2026-10-12 19:28:54', '1517', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','295-15,','1','1','0','0','395','5925','0','','0','0.00','0','0','0','0'); -- id=1604
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 1604;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1517, '2026-10-12', 5925, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5925, 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+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 5925, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5925, 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 = '60', userid = '2', storedetaildate = '2026-10-12 19:28:54' WHERE storedetailid = '1542';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1517', '1', '15', '1', '458', 'اضافة فاتورة مبيعات', 'sellbillController.php', '75', '60', '2', '2026-10-12 19:28:54','0','0'); -- id=4916
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2648220',  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 ('2584405','63815', '0', '2', 'اضافة فاتورة مبيعات', '458', '2648220', '2026-10-12 19:28:54', '2',  'sellbillController.php','1','','0'); -- id=567
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '63815', '63815', '2026-10-12', '2', '0', '0', '2026-10-12 19:28:54','اضافة فاتورة مبيعات رقم 458','1','0',null,'0','458','sellbillController.php?do=showDetail&sellbillid=458'); -- id=2181
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2181', '419', '63815', '','0'); -- id=2225
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2648220', 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 ('2181', '143', '63815', '','0'); -- id=2183
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4537415', 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 ( '60470', '60470', '2026-10-12', '2', '0', '0', '2026-10-12 19:28:54','اضافة فاتورة مبيعات رقم 458 - صرف البضاعة من المخزن','1','0',null,'0','458','sellbillController.php?do=showDetail&sellbillid=458'); -- id=2182
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2182', '402', '60470', '','0'); -- id=2226
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4240317.47', 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 ('2182', '382', '60470', '','0'); -- id=2184
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '21324971.23', 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='2181,0,2182' where sellbillid=458;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 63815, 61070, 61070
                    , 61070, 60470, 60470, 60470
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,61070, 61070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+63815, sellCostBuyPrice =sellCostBuyPrice+61070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+61070, sellCostMeanBuyPrice = sellCostMeanBuyPrice+61070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+60470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+60470
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+60470
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+61070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61070
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 63815, 61070, 61070
                    , 61070, 60470, 60470, 60470
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,61070, 61070, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+63815, sellCostBuyPrice =sellCostBuyPrice+61070
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+61070, sellCostMeanBuyPrice = sellCostMeanBuyPrice+61070
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+60470, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+60470
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+60470
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+61070
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+61070
                        , returnSellVal = returnSellVal+0, 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, 63815, 61070, 61070
                    , 61070, 60470, 60470, 60470, 61070, 61070)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+63815, netSellCostBuyPrice = netSellCostBuyPrice+61070
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+61070
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+61070
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+60470
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+60470
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+60470
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+61070
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+61070;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acd005098753 and sellbillId = 458 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 15:58:54";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:28:54", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 19:28:54', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8065
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:02:43";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:02:43";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:02:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:32:45", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 19:32:45', '6', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=8066
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:02:45";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 19:32:45", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 19:32:45', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=8067
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:02:47";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:32:47", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 19:32:47', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8068
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:04:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:34:28", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 19:34:28', '6', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=8069

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acd0bafc472c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 19:34:28', '06acd0bafc472c', '1', '0.00', '0', '0', '1', '12800.00', '12800', '12800', '0', '1', '2026-10-12 19:34:28', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '16' ,'0','','','','','-1','0','0','0','0','0','12800','0','','0','0','12800','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=459
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','459', '0', '2026-10-12 19:34:28', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '12800', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 19:34:28','0','0','',''); -- id=592
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+16 where id = 454;
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','01598', '459', '118', '1598', '16', '800', '12800', '0', '', '0', '2026-10-12 19:34:28', '1598', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','454-16,','1','1','0','0','800','12800','0','','0','0.00','0','0','0','0'); -- id=1605
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 = 1605;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1598, '2026-10-12', 12800, 11200, 11200
                    , 11200, 11200, 11200, 11200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16, 0, 11200, 11200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12800, sellCostBuyPrice =sellCostBuyPrice+11200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 12800, 11200, 11200
                    , 11200, 11200, 11200, 11200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11200, 11200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12800, sellCostBuyPrice =sellCostBuyPrice+11200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '556', userid = '6', storedetaildate = '2026-10-12 19:34:28' WHERE storedetailid = '1623';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1598', '1', '16', '1', '459', 'اضافة فاتورة مبيعات', 'sellbillController.php', '572', '556', '6', '2026-10-12 19:34:28','0','0'); -- id=4917
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '187335',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('174535','12800', '0', '4', 'اضافة فاتورة مبيعات', '459', '187335', '2026-10-12 19:34:28', '6',  'sellbillController.php','1','','0'); -- id=568
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '12800', '12800', '2026-10-12', '6', '0', '0', '2026-10-12 19:34:28','اضافة فاتورة مبيعات رقم 459','1','0',null,'0','459','sellbillController.php?do=showDetail&sellbillid=459'); -- id=2183
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2183', '568', '12800', '','0'); -- id=2227
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '187335', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2183', '143', '12800', '','0'); -- id=2185
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4550215', 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 ( '11200', '11200', '2026-10-12', '6', '0', '0', '2026-10-12 19:34:28','اضافة فاتورة مبيعات رقم 459 - صرف البضاعة من المخزن','1','0',null,'0','459','sellbillController.php?do=showDetail&sellbillid=459'); -- id=2184
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2184', '402', '11200', '','0'); -- id=2228
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4251517.47', 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 ('2184', '382', '11200', '','0'); -- id=2186
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '21313771.23', 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='2183,0,2184' where sellbillid=459;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 12800, 11200, 11200
                    , 11200, 11200, 11200, 11200
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11200, 11200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12800, sellCostBuyPrice =sellCostBuyPrice+11200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 12800, 11200, 11200
                    , 11200, 11200, 11200, 11200
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11200, 11200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12800, sellCostBuyPrice =sellCostBuyPrice+11200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11200
                        , returnSellVal = returnSellVal+0, 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, 12800, 11200, 11200
                    , 11200, 11200, 11200, 11200, 11200, 11200)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+12800, netSellCostBuyPrice = netSellCostBuyPrice+11200
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+11200
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+11200
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+11200
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+11200
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+11200
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+11200
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+11200;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acd0bafc472c and sellbillId = 459 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:04:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:34:28", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 19:34:28', '6', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8070
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:12:10";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:12:24";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:42:24", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 19:42:24', '4', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=8071
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:12:24";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 19:42:24", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 19:42:24', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=8072
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:12:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:42:28", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 19:42:28', '4', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=8073
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:15:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:45:00", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 19:45:00', '4', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8074
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:15:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:45:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 19:45:51', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=8075

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acd0ac689007
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 19:45:51', '06acd0ac689007', '1', '0.00', '0', '0', '1', '19410.00', '19410', '19410', '0', '1', '2026-10-12 19:45:51', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '41' ,'0','','','','','-1','0','0','0','0','0','19410','0','','0','0','19410','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=460
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','اضافة فاتورة مبيعات','460', '0', '2026-10-12 19:45:51', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '19410', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 19:45:51','0','0','',''); -- id=593
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 930;
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','01857', '460', '145', '1857', '6', '450', '2700', '0', '', '0', '2026-10-12 19:45:51', '1857', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','930-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=1606
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 = 1606;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1857, '2026-10-12', 2700, 2490, 2490
                    , 2490, 2490, 2490, 2490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2490, 2490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2700, 2490, 2490
                    , 2490, 2490, 2490, 2490
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2490, 2490, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2490
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2490
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2490
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2490
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2490
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2490
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 19:45:51' WHERE storedetailid = '2874';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1857', '1', '6', '1', '460', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '12', '2', '2026-10-12 19:45:51','0','0'); -- id=4918
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 932;
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 ('435','01859', '460', '145', '1859', '6', '470', '2820', '0', '', '0', '2026-10-12 19:45:51', '1859', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','932-6,','1','1','0','0','470','2820','0','','0','0.00','0','0','0','0'); -- id=1607
UPDATE sellbilldetail SET  lastbuyprice = 435.00 , meanbuyprice = 435.00, lastbuyprice_withDiscount = 435.00, meanbuyprice_withDiscount = 435.00
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 435, lastbuyprice_withDiscountAndTax = 435
                where sellbilldetailid = 1607;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1859, '2026-10-12', 2820, 2610, 2610
                    , 2610, 2610, 2610, 2610
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2610, 2610, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2820, sellCostBuyPrice =sellCostBuyPrice+2610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2610
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2610
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2820, 2610, 2610
                    , 2610, 2610, 2610, 2610
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2610, 2610, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2820, sellCostBuyPrice =sellCostBuyPrice+2610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2610
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2610
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2610
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 19:45:51' WHERE storedetailid = '2876';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1859', '1', '6', '1', '460', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '18', '2', '2026-10-12 19:45:51','0','0'); -- id=4919
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 70;
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','01378', '460', '94', '1378', '6', '360', '2160', '0', '', '0', '2026-10-12 19:45:51', '1378', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','70-6,','1','1','0','0','360','2160','0','','0','0.00','0','0','0','0'); -- id=1608
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 = 1608;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1378, '2026-10-12', 2160, 1920, 1920
                    , 1920, 1920, 1920, 1920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2160, 1920, 1920
                    , 1920, 1920, 1920, 1920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '576', userid = '2', storedetaildate = '2026-10-12 19:45:51' WHERE storedetailid = '1378';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1378', '1', '6', '1', '460', 'اضافة فاتورة مبيعات', 'sellbillController.php', '582', '576', '2', '2026-10-12 19:45:51','0','0'); -- id=4920
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 447;
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 ('496.8','01595', '460', '116', '1595', '8', '540', '4320', '0', '', '0', '2026-10-12 19:45:51', '1595', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','447-8,','1','1','0','0','540','4320','0','','0','0.00','0','0','0','0'); -- id=1609
UPDATE sellbilldetail SET  lastbuyprice = 540.00 , meanbuyprice = 540.00, lastbuyprice_withDiscount = 496.80, meanbuyprice_withDiscount = 496.80
        , lastbuyprice_withTax = 540, meanbuyprice_withTax = 540, lastbuyprice_withDiscountAndTax = 496.8
                where sellbilldetailid = 1609;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1595, '2026-10-12', 4320, 4320, 4320
                    , 4320, 3974.4, 3974.4, 3974.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 4320, 4320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4320, sellCostBuyPrice =sellCostBuyPrice+4320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3974.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3974.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3974.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 4320, 4320, 4320
                    , 4320, 3974.4, 3974.4, 3974.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4320, 4320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4320, sellCostBuyPrice =sellCostBuyPrice+4320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3974.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3974.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3974.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '2', storedetaildate = '2026-10-12 19:45:51' WHERE storedetailid = '1620';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1595', '1', '8', '1', '460', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '28', '2', '2026-10-12 19:45:51','0','0'); -- id=4921
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 515;
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 ('515.2','01666', '460', '124', '1666', '6', '560', '3360', '0', '', '0', '2026-10-12 19:45:51', '1666', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','515-6,','1','1','0','0','560','3360','0','','0','0.00','0','0','0','0'); -- id=1610
UPDATE sellbilldetail SET  lastbuyprice = 560.00 , meanbuyprice = 560.00, lastbuyprice_withDiscount = 515.20, meanbuyprice_withDiscount = 515.20
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 515.2
                where sellbilldetailid = 1610;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1666, '2026-10-12', 3360, 3360, 3360
                    , 3360, 3091.2, 3091.2, 3091.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3360, 3360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3360, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3091.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3091.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3091.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 3360, 3360, 3360
                    , 3360, 3091.2, 3091.2, 3091.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3360, 3360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3360, sellCostBuyPrice =sellCostBuyPrice+3360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3091.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3091.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3091.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-12 19:45:51' WHERE storedetailid = '2678';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1666', '1', '6', '1', '460', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '3', '2', '2026-10-12 19:45:51','0','0'); -- id=4922
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 84;
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','01392', '460', '95', '1392', '3', '400', '1200', '0', '', '0', '2026-10-12 19:45:51', '1392', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','84-3,','1','1','0','0','400','1200','0','','0','0.00','0','0','0','0'); -- id=1611
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 1611;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1392, '2026-10-12', 1200, 1200, 1200
                    , 1200, 1080, 1140, 1080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1200, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 1200, 1200, 1200
                    , 1200, 1080, 1140, 1080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1200, 600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+1200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-10-12 19:45:51' WHERE storedetailid = '1392';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1392', '1', '3', '1', '460', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '24', '2', '2026-10-12 19:45:51','0','0'); -- id=4923
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 862;
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 ('437','01837', '460', '124', '1837', '6', '475', '2850', '0', '', '0', '2026-10-12 19:45:51', '1837', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','862-6,','1','1','0','0','475','2850','0','','0','0.00','0','0','0','0'); -- id=1612
UPDATE sellbilldetail SET  lastbuyprice = 475.00 , meanbuyprice = 475.00, lastbuyprice_withDiscount = 437.00, meanbuyprice_withDiscount = 437.00
        , lastbuyprice_withTax = 475, meanbuyprice_withTax = 475, lastbuyprice_withDiscountAndTax = 437
                where sellbilldetailid = 1612;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1837, '2026-10-12', 2850, 2850, 2850
                    , 2850, 2622, 2622, 2622
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2850, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2622, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2622
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2622
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2850, 2850, 2850
                    , 2850, 2622, 2622, 2622
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2850, 2850, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2850, sellCostBuyPrice =sellCostBuyPrice+2850
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2850
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2622, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2622
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2622
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2850
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2850
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '2', storedetaildate = '2026-10-12 19:45:51' WHERE storedetailid = '2852';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1837', '1', '6', '1', '460', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '21', '2', '2026-10-12 19:45:51','0','0'); -- id=4924
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2667630',  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 ('2648220','19410', '0', '2', 'اضافة فاتورة مبيعات', '460', '2667630', '2026-10-12 19:45:51', '2',  'sellbillController.php','1','','0'); -- id=569
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '19410', '19410', '2026-10-12', '2', '0', '0', '2026-10-12 19:45:51','اضافة فاتورة مبيعات رقم 460','1','0',null,'0','460','sellbillController.php?do=showDetail&sellbillid=460'); -- id=2185
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2185', '419', '19410', '','0'); -- id=2229
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2667630', 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 ('2185', '143', '19410', '','0'); -- id=2187
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4569625', 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 ( '17787.6', '17787.6', '2026-10-12', '2', '0', '0', '2026-10-12 19:45:51','اضافة فاتورة مبيعات رقم 460 - صرف البضاعة من المخزن','1','0',null,'0','460','sellbillController.php?do=showDetail&sellbillid=460'); -- id=2186
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2186', '402', '17787.6', '','0'); -- id=2230
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4269305.07', 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 ('2186', '382', '17787.6', '','0'); -- id=2188
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '21295983.63', 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='2185,0,2186' where sellbillid=460;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 19410, 18750, 18750
                    , 18750, 17787.6, 17847.6, 17787.6
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18750, 18150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19410, sellCostBuyPrice =sellCostBuyPrice+18750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17787.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17847.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17787.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 19410, 18750, 18750
                    , 18750, 17787.6, 17847.6, 17787.6
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,18750, 18150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19410, sellCostBuyPrice =sellCostBuyPrice+18750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+18750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+18750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17787.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17847.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17787.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+18750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+18150
                        , returnSellVal = returnSellVal+0, 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, 19410, 18750, 18750
                    , 18750, 17787.6, 17847.6, 17787.6, 18750, 18150)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+19410, netSellCostBuyPrice = netSellCostBuyPrice+18750
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+18750
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+18750
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+17787.6
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+17847.6
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+17787.6
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+18750
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+18150;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acd0ac689007 and sellbillId = 460 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:15:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:45:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 19:45:51', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8076
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:24:37";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:24:37";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:24:39";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:54:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 19:54:39', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=8077
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:24:40";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 19:54:40', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=8078
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:25:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:55:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 19:55:00', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=8079
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:25:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:55:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 19:55:18', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=8080
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:25:30";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:55:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-12 19:55:30', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=8081
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:25:47";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:55:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-10-12 19:55:47', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellBillReportsController.php'); -- id=8082
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:26:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:56:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreportbills.php', '2026-10-12 19:56:15', '1', 'showbills', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreportbills.php?do=showbills'); -- id=8083
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:26:57";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:56:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 19:56:57', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=8084
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:26:57";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 19:56:57', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=8085
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:26:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:56:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 19:56:58', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=8086
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:26:58";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 19:56:58', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=8087
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:27:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:57:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('ReturnSellBillReportsController.php', '2026-10-12 19:57:06', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/ReturnSellBillReportsController.php?do=show'); -- id=8088
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:27:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:57:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-10-12 19:57:16', '1', 'sellandreturnreport', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellBillReportsController.php?do=sellandreturnreport'); -- id=8089
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:27:50";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:57:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellBillReportsController.php', '2026-10-12 19:57:50', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellBillReportsController.php'); -- id=8090
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:27:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:57:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreportbills.php', '2026-10-12 19:57:58', '1', 'showbills', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreportbills.php?do=showbills'); -- id=8091
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:28:19";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:58:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 19:58:19', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=8092
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:28:26";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 19:58:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 19:58:26', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=8093
UPDATE user SET loginip = "" WHERE userid = 6;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:38:34";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:08:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:08:34', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=8094
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:39:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:09:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:09:00', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=8095

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acd1412c03c5
-- ----------------------------------------------------------------------------------------------------

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-10-12 20:09:00', '06acd1412c03c5', '1', '0.00', '0', '0', '1', '2275', '2275', '-2275', '0', '1', '2026-10-12 20:09:00', '', '2', '0', 'نقدي','2', '0', '5', '0', 'نقدي', '5', '0', '', '','','','-1','0','0','0','','0','-2275','0','0','0','0','0','0','0','0','-1','0','0','1','','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','1','اضافة فاتورة مردوات مبيعات','15', '0', '2026-10-12 20:09:00', '2', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '2275', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 20:09:00','0','0','',''); -- id=594
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 ('435.00', '09714', '15', '11', '770', '5', '455', '2275', '0', '', '0', '0', '770', '0.00', '0','1','0','','','0','0','0','0','0','0','1','1','','0','0','455','2275','0','','0'); -- id=23
UPDATE returnsellbilldetail SET  lastbuyprice = 435.00 , meanbuyprice = 435.00, lastbuyprice_withDiscount = 435.00, meanbuyprice_withDiscount = 435.00
        , lastbuyprice_withTax = 435, meanbuyprice_withTax = 435, lastbuyprice_withDiscountAndTax = 435
                where returnsellbilldetailid = 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 (770, '2026-10-12', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2275, 2175, 2175, 2175
                    , 2175, 2175, 2175, 0, 5, 0, 0, 2175, 2175)
                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+2275, returnSellCostBuyPrice = returnSellCostBuyPrice+2175, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2175
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2175, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2175
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2175
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2175
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2175
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2175
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+5;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2275, 2175, 2175, 2175
                    , 2175, 2175, 2175, 0, 0, 2175, 2175)
                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+2275, returnSellCostBuyPrice = returnSellCostBuyPrice+2175, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2175
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2175, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2175
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2175
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2175
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2175
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2175;
UPDATE storedetail SET  productquantity = '333', userid = '2', storedetaildate = '2026-10-12 20:09:00' WHERE storedetailid = '770';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('770', '1', '5', '0', '15', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '328', '333', '2', '2026-10-12 20:09:00','0','0'); -- id=4925
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2665355',  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 ('2667630','-2275', '1', '2', 'اضافة فاتورة مردوات مبيعات', '15', '2665355', '2026-10-12 20:09:00', '2',  'returnsellbillController.php','1','','0'); -- id=570
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2275', '2275', '2026-10-12', '2', '0', '0', '2026-10-12 20:09:00','اضافة فاتورة مردود مبيعات رقم 15','1','0',null,'0','15','returnsellbillController.php?do=showDetail&returnsellbillid=15'); -- id=2187
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2187', '143', '2275', '','0'); -- id=2231
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4567350', 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 ('2187', '419', '2275', '','0'); -- id=2189
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2665355', 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 ( '2175', '2175', '2026-10-12', '2', '0', '0', '2026-10-12 20:09:00','اضافة فاتورة مردود مبيعات رقم 15 - صرف البضاعة من المخزن','1','0',null,'0','15','returnsellbillController.php?do=showDetail&returnsellbillid=15'); -- id=2188
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2188', '382', '2175', '','0'); -- id=2232
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '21298158.63', 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 ('2188', '402', '2175', '','0'); -- id=2190
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4267130.07', 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='2187,0,2188' where returnsellbillid=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-10-12', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2275, 2175, 2175, 2175
                    , 2175, 2175, 2175 ,0, 0, 2175, 2175)
                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+2275, returnSellCostBuyPrice = returnSellCostBuyPrice+2175, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2175
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2175, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2175
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2175
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2175
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2175
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2175;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2275, 2175, 2175, 2175
                    , 2175, 2175, 2175 ,0, 0, 2175, 2175)
                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+2275, returnSellCostBuyPrice = returnSellCostBuyPrice+2175, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2175
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2175, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2175
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2175
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2175
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2175
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2175;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -2275, -2175, -2175
                    , -2175, -2175, -2175, -2175, -2175, -2175)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-2275, netSellCostBuyPrice = netSellCostBuyPrice+-2175
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-2175
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-2175
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-2175
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-2175
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-2175
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-2175
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-2175;
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:39:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:09:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:09:00', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=8096
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:39:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:09:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 20:09:41', '2', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=8097
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:39:42";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 20:09:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 20:09:42', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=8098
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:39:44";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:09:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:09:44', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8099
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:41:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:11:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 20:11:53', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=8100
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:42:08";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:12:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 20:12:08', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=8101
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:42:19";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:12:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsnewController.php', '2026-10-12 20:12:19', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsnewController.php'); -- id=8102
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:42:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:12:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsnewController.php', '2026-10-12 20:12:28', '1', 'supplierShow2', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsnewController.php?do=supplierShow2'); -- id=8103
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:43:57";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:13:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsnewController.php', '2026-10-12 20:13:57', '1', 'supplierShow2', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsnewController.php?do=supplierShow2'); -- id=8104
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:44:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:14:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 20:14:16', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=8105
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:44:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:14:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 20:14:18', '2', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=8106
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:44:18";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-12 20:14:18", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 20:14:18', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=8107
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:44:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:14:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:14:20', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=8108
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:44:27";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:14:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-12 20:14:27', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=8109
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:49:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:19:22", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:19:22', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=8110

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acd1458d1a96
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 20:19:22', '06acd1458d1a96', '1', '0.00', '0', '0', '1', '2370.00', '2370', '2370', '0', '1', '2026-10-12 20:19:22', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2370','0','','0','0','2370','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=461
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','اضافة فاتورة مبيعات','461', '0', '2026-10-12 20:19:22', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2370', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 20:19:22','0','0','',''); -- id=595
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 985;
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 ('364','01891', '461', '147', '1891', '6', '395', '2370', '0', '', '0', '2026-10-12 20:19:22', '1891', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','985-6,','1','1','0','0','395','2370','0','','0','0.00','0','0','0','0'); -- id=1613
UPDATE sellbilldetail SET  lastbuyprice = 364.00 , meanbuyprice = 364.00, lastbuyprice_withDiscount = 364.00, meanbuyprice_withDiscount = 364.00
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where sellbilldetailid = 1613;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1891, '2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '330', userid = '2', storedetaildate = '2026-10-12 20:19:22' WHERE storedetailid = '2908';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1891', '1', '6', '1', '461', 'اضافة فاتورة مبيعات', 'sellbillController.php', '336', '330', '2', '2026-10-12 20:19:22','0','0'); -- id=4926
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2667725',  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 ('2665355','2370', '0', '2', 'اضافة فاتورة مبيعات', '461', '2667725', '2026-10-12 20:19:22', '2',  'sellbillController.php','1','','0'); -- id=571
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2370', '2370', '2026-10-12', '2', '0', '0', '2026-10-12 20:19:22','اضافة فاتورة مبيعات رقم 461','1','0',null,'0','461','sellbillController.php?do=showDetail&sellbillid=461'); -- id=2189
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2189', '419', '2370', '','0'); -- id=2233
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2667725', 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 ('2189', '143', '2370', '','0'); -- id=2191
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4569720', 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 ( '2184', '2184', '2026-10-12', '2', '0', '0', '2026-10-12 20:19:22','اضافة فاتورة مبيعات رقم 461 - صرف البضاعة من المخزن','1','0',null,'0','461','sellbillController.php?do=showDetail&sellbillid=461'); -- id=2190
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2190', '402', '2184', '','0'); -- id=2234
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4269314.07', 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 ('2190', '382', '2184', '','0'); -- id=2192
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '21295974.63', 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='2189,0,2190' where sellbillid=461;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, 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, 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184, 2184, 2184)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2370, netSellCostBuyPrice = netSellCostBuyPrice+2184
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2184
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2184
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2184
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2184
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2184
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2184
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2184;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acd1458d1a96 and sellbillId = 461 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:49:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:19:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:19:23', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8111
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:51:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:21:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:21:02', '2', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=8112

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acd169b2b95a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 20:21:02', '06acd169b2b95a', '1', '0.00', '0', '0', '1', '2370.00', '2370', '2370', '0', '1', '2026-10-12 20:21:02', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2370','0','','0','0','2370','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=462
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','اضافة فاتورة مبيعات','462', '0', '2026-10-12 20:21:02', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2370', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 20:21:02','0','0','',''); -- id=596
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 985;
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 ('364','01891', '462', '147', '1891', '6', '395', '2370', '0', '', '0', '2026-10-12 20:21:02', '1891', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','985-6,','1','1','0','0','395','2370','0','','0','0.00','0','0','0','0'); -- id=1614
UPDATE sellbilldetail SET  lastbuyprice = 364.00 , meanbuyprice = 364.00, lastbuyprice_withDiscount = 364.00, meanbuyprice_withDiscount = 364.00
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where sellbilldetailid = 1614;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1891, '2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '324', userid = '2', storedetaildate = '2026-10-12 20:21:02' WHERE storedetailid = '2908';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1891', '1', '6', '1', '462', 'اضافة فاتورة مبيعات', 'sellbillController.php', '330', '324', '2', '2026-10-12 20:21:02','0','0'); -- id=4927
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2670095',  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 ('2667725','2370', '0', '2', 'اضافة فاتورة مبيعات', '462', '2670095', '2026-10-12 20:21:02', '2',  'sellbillController.php','1','','0'); -- id=572
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2370', '2370', '2026-10-12', '2', '0', '0', '2026-10-12 20:21:02','اضافة فاتورة مبيعات رقم 462','1','0',null,'0','462','sellbillController.php?do=showDetail&sellbillid=462'); -- id=2191
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2191', '419', '2370', '','0'); -- id=2235
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2670095', 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 ('2191', '143', '2370', '','0'); -- id=2193
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4572090', 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 ( '2184', '2184', '2026-10-12', '2', '0', '0', '2026-10-12 20:21:02','اضافة فاتورة مبيعات رقم 462 - صرف البضاعة من المخزن','1','0',null,'0','462','sellbillController.php?do=showDetail&sellbillid=462'); -- id=2192
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2192', '402', '2184', '','0'); -- id=2236
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4271498.07', 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 ('2192', '382', '2184', '','0'); -- id=2194
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '21293790.63', 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='2191,0,2192' where sellbillid=462;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, 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, 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184, 2184, 2184)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2370, netSellCostBuyPrice = netSellCostBuyPrice+2184
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2184
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2184
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2184
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2184
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2184
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2184
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2184;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acd169b2b95a and sellbillId = 462 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:51:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:21:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:21:03', '2', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8113
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:51:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:21:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:21:13', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8114
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:51:30";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:21:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:21:30', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=8115
BEGIN;
CALL supplierInUse(105,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('105', '417096.00', '50000', '1', 'ايصال دفع لمورد', '1', '367096', '2026-10-12 20:21:13', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','50000','1','0','0','0','60',''); -- id=407
UPDATE supplierdebtchange SET supplierid = '105', supplierdebtchangebefore = '417096.00', supplierdebtchangeamount = '50000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '367096', supplierdebtchangedate = '2026-10-12 20:21:13', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='417096',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='367096', paySerialNo='60',tagids='' WHERE supplierdebtchangeid = '407';
UPDATE supplier SET  suppliercurrentDebt = '367096',suppliercurrentDebtInCurrency= '367096' , userid = '1', supplierdate = '2026-10-12 20:21:30'   WHERE supplierid = '105';
UPDATE supplier SET  inUse = 0 where supplierid = 105;
UPDATE save SET  savecurrentvalue = '-34649330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34599330.00','50000', '1', '1', 'ايصال دفع لمورد', '407', '-34649330', '2026-10-12 20:21:30', '1',  'supplierPayedDeptController.php','0','','0'); -- id=573
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50000', '50000', '2026-10-12', '1', '0', '0', '2026-10-12 20:21:30','ايصال دفع لمورد ( الحريف ) ','1','0','0','0','407','supplierReportsController.php?do=show&id=407'); -- id=2193
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2193', '588', '50000', '','0'); -- id=2237
UPDATE accountstree SET name = 'الحريف', customName = 'الحريف', customNameEn = 'الحريف', nameEn = 'الحريف', parent = '81', accountNature = '1', theValue = '367096', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 20:25:30' WHERE id = '588';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2193', '383', '50000', '','0'); -- id=2195
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-34649330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '105', supplierdebtchangebefore = '417096.00', supplierdebtchangeamount = '50000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '367096.00', supplierdebtchangedate = '2026-10-12 20:21:13', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2193',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='417096',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='367096', paySerialNo='60',tagids='' WHERE supplierdebtchangeid = '407';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:51:30";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:21:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:21:30', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=8116
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:51:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:21:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:21:31', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=8117
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:51:32";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:21:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:21:32', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=8118
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:51:36";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:21:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:21:36', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8119
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:54:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:24:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:24:51', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=8120
BEGIN;
CALL supplierInUse(33,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('33', '133317.00', '20000', '1', 'ايصال دفع لمورد', '1', '113317', '2026-10-12 20:21:36', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','20000','1','0','0','0','61',''); -- id=408
UPDATE supplierdebtchange SET supplierid = '33', supplierdebtchangebefore = '133317.00', supplierdebtchangeamount = '20000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '113317', supplierdebtchangedate = '2026-10-12 20:21:36', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='546030',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='113317', paySerialNo='61',tagids='' WHERE supplierdebtchangeid = '408';
UPDATE supplier SET  suppliercurrentDebt = '113317',suppliercurrentDebtInCurrency= '113317' , userid = '1', supplierdate = '2026-10-12 20:24:51'   WHERE supplierid = '33';
UPDATE supplier SET  inUse = 0 where supplierid = 33;
UPDATE save SET  savecurrentvalue = '-34669330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34649330.00','20000', '1', '1', 'ايصال دفع لمورد', '408', '-34669330', '2026-10-12 20:24:51', '1',  'supplierPayedDeptController.php','0','','0'); -- id=574
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20000', '20000', '2026-10-12', '1', '0', '0', '2026-10-12 20:24:51','ايصال دفع لمورد ( هشام صلاح ( القيصر) - مورد ) ','1','0','0','0','408','supplierReportsController.php?do=show&id=408'); -- id=2194
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2194', '452', '20000', '','0'); -- id=2238
UPDATE accountstree SET name = 'هشام صلاح ( القيصر) - مورد', customName = 'هشام صلاح ( القيصر) - مورد', customNameEn = 'هشام صلاح ( القيصر) - مورد', nameEn = 'هشام صلاح ( القيصر) - مورد', parent = '81', accountNature = '1', theValue = '-20000', 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 = '452';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2194', '383', '20000', '','0'); -- id=2196
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-34669330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '33', supplierdebtchangebefore = '133317.00', supplierdebtchangeamount = '20000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '113317.00', supplierdebtchangedate = '2026-10-12 20:21:36', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2194',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='546030',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='113317', paySerialNo='61',tagids='' WHERE supplierdebtchangeid = '408';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:54:52";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:24:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:24:52', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=8121
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:54:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:24:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:24:53', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=8122
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:54:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:24:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:24:53', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=8123
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:55:05";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:25:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:25:05', '1', 'edit', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=edit&id=408'); -- id=8124
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:55:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:25:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:25:20', '1', 'remove', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=remove&id=408&dailyentry=2194'); -- id=8125
BEGIN;
CALL supplierInUse(33,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
UPDATE supplier SET  suppliercurrentDebt = '133317',suppliercurrentDebtInCurrency= '133317' , userid = '1', supplierdate = '2026-10-12 20:21:36'   WHERE supplierid = '33';
UPDATE supplier SET  inUse = 0 where supplierid = 33;
UPDATE supplierdebtchange SET del = '1' WHERE supplierdebtchangeid = '408';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, del, dailyentryid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('33', '113317.00', '20000.00', '1', 'الغاء سداد ديون مورد', '-1', '133317', '2026-10-12 20:25:20', '1', 'supplierPayedDeptController.php', 'delRow408', '1', '2194','1','1','20000','1','113317','20000','133317','0','0'); -- id=409
UPDATE save SET  savecurrentvalue = '-34649330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34669330.00','20000', '1', '1', 'الغاء سداد ديون مورد', '409', '-34649330', '2026-10-12 20:25:20', '1',  'supplierReportsController.php','0','','0'); -- id=575
UPDATE dailyentry SET totalcreditor = '20000.00', totaldebtor = '20000.00', thedate = '2026-10-12', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-12 20:24:51', entryComment = 'ايصال دفع لمورد ( هشام صلاح ( القيصر) - مورد ) ', fromFlag = '1',related='0',isopeningentry='0',operationId='408',operationDetailLink='supplierReportsController.php?do=show&id=408' WHERE id = '2194';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20000.00', '20000.00', '2026-10-12', '1', '0', '2194', '2026-10-12 20:25:20','تم عكس القيد رقم 2194 ','1','0','0','0','0',''); -- id=2195
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2195', '452', '20000.00', '','0'); -- id=2197
UPDATE accountstree SET name = 'هشام صلاح ( القيصر) - مورد', customName = 'هشام صلاح ( القيصر) - مورد', customNameEn = 'هشام صلاح ( القيصر) - مورد', nameEn = 'هشام صلاح ( القيصر) - مورد', parent = '81', accountNature = '1', theValue = '0', 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 = '452';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2195', '383', '20000.00', '','0'); -- id=2239
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-34649330', 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';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:55:20";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:25:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:25:20', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=sucess'); -- id=8126
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:55:21";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:25:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:25:21', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=show'); -- id=8127
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:55:28";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:25:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:25:28', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8128
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:55:40";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:25:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:25:40', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=8129
BEGIN;
CALL supplierInUse(33,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('33', '133317.00', '15000', '1', 'ايصال دفع لمورد', '1', '118317', '2026-10-12 20:25:28', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','15000','1','0','0','0','62',''); -- id=410
UPDATE supplierdebtchange SET supplierid = '33', supplierdebtchangebefore = '133317.00', supplierdebtchangeamount = '15000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '118317', supplierdebtchangedate = '2026-10-12 20:25:28', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='15000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='133317',debtchangamountInSupplierCurrency='15000',debtchangafterInSupplierCurrency='118317', paySerialNo='62',tagids='' WHERE supplierdebtchangeid = '410';
UPDATE supplier SET  suppliercurrentDebt = '118317',suppliercurrentDebtInCurrency= '118317' , userid = '1', supplierdate = '2026-10-12 20:25:40'   WHERE supplierid = '33';
UPDATE supplier SET  inUse = 0 where supplierid = 33;
UPDATE save SET  savecurrentvalue = '-34664330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34649330.00','15000', '1', '1', 'ايصال دفع لمورد', '410', '-34664330', '2026-10-12 20:25:40', '1',  'supplierPayedDeptController.php','0','','0'); -- id=576
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '15000', '15000', '2026-10-12', '1', '0', '0', '2026-10-12 20:25:40','ايصال دفع لمورد ( هشام صلاح ( القيصر) - مورد ) ','1','0','0','0','410','supplierReportsController.php?do=show&id=410'); -- id=2196
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2196', '452', '15000', '','0'); -- id=2240
UPDATE accountstree SET name = 'هشام صلاح ( القيصر) - مورد', customName = 'هشام صلاح ( القيصر) - مورد', customNameEn = 'هشام صلاح ( القيصر) - مورد', nameEn = 'هشام صلاح ( القيصر) - مورد', parent = '81', accountNature = '1', theValue = '-15000', 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 = '452';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2196', '383', '15000', '','0'); -- id=2198
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-34664330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '33', supplierdebtchangebefore = '133317.00', supplierdebtchangeamount = '15000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '118317.00', supplierdebtchangedate = '2026-10-12 20:25:28', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2196',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='15000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='133317',debtchangamountInSupplierCurrency='15000',debtchangafterInSupplierCurrency='118317', paySerialNo='62',tagids='' WHERE supplierdebtchangeid = '410';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:55:40";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:25:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:25:40', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=8130
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:55:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:25:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:25:42', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=8131
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:55:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:25:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:25:42', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=8132
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:55:47";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:25:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:25:47', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8133
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:26:00', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=8134
BEGIN;
CALL supplierInUse(4,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('4', '70360.00', '20000', '1', 'ايصال دفع لمورد', '1', '50360', '2026-10-12 20:25:47', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','20000','1','0','0','0','63',''); -- id=411
UPDATE supplierdebtchange SET supplierid = '4', supplierdebtchangebefore = '70360.00', supplierdebtchangeamount = '20000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '50360', supplierdebtchangedate = '2026-10-12 20:25:47', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='546030',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='50360', paySerialNo='63',tagids='' WHERE supplierdebtchangeid = '411';
UPDATE supplier SET  suppliercurrentDebt = '50360',suppliercurrentDebtInCurrency= '50360' , userid = '1', supplierdate = '2026-10-12 20:26:00'   WHERE supplierid = '4';
UPDATE supplier SET  inUse = 0 where supplierid = 4;
UPDATE save SET  savecurrentvalue = '-34684330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34664330.00','20000', '1', '1', 'ايصال دفع لمورد', '411', '-34684330', '2026-10-12 20:26:00', '1',  'supplierPayedDeptController.php','0','','0'); -- id=577
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20000', '20000', '2026-10-12', '1', '0', '0', '2026-10-12 20:26:00','ايصال دفع لمورد ( الديك - مورد ) ','1','0','0','0','411','supplierReportsController.php?do=show&id=411'); -- id=2197
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2197', '423', '20000', '','0'); -- id=2241
UPDATE accountstree SET name = 'الديك - مورد', customName = 'الديك - مورد', customNameEn = 'الديك - مورد', nameEn = 'الديك - مورد', parent = '81', accountNature = '1', theValue = '-20000', 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 = '423';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2197', '383', '20000', '','0'); -- id=2199
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-34684330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '4', supplierdebtchangebefore = '70360.00', supplierdebtchangeamount = '20000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '50360.00', supplierdebtchangedate = '2026-10-12 20:25:47', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2197',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='546030',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='50360', paySerialNo='63',tagids='' WHERE supplierdebtchangeid = '411';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:01";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:26:01', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=8135
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:26:02', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=8136
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:26:02', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=8137
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:05";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:26:05', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8138
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:26:15', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=8139
BEGIN;
CALL supplierInUse(89,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('89', '58000.00', '30000', '1', 'ايصال دفع لمورد', '1', '28000', '2026-10-12 20:26:05', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','64',''); -- id=412
UPDATE supplierdebtchange SET supplierid = '89', supplierdebtchangebefore = '58000.00', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '28000', supplierdebtchangedate = '2026-10-12 20:26:05', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='58000',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='28000', paySerialNo='64',tagids='' WHERE supplierdebtchangeid = '412';
UPDATE supplier SET  suppliercurrentDebt = '28000',suppliercurrentDebtInCurrency= '28000' , userid = '1', supplierdate = '2026-10-12 20:26:15'   WHERE supplierid = '89';
UPDATE supplier SET  inUse = 0 where supplierid = 89;
UPDATE save SET  savecurrentvalue = '-34714330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34684330.00','30000', '1', '1', 'ايصال دفع لمورد', '412', '-34714330', '2026-10-12 20:26:15', '1',  'supplierPayedDeptController.php','0','','0'); -- id=578
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-12', '1', '0', '0', '2026-10-12 20:26:15','ايصال دفع لمورد ( تيتو بولاق ) ','1','0','0','0','412','supplierReportsController.php?do=show&id=412'); -- id=2198
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2198', '570', '30000', '','0'); -- id=2242
UPDATE accountstree SET name = 'تيتو بولاق', customName = 'تيتو بولاق', customNameEn = 'تيتو بولاق', nameEn = 'تيتو بولاق', parent = '81', accountNature = '1', theValue = '28000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 17:44:52' WHERE id = '570';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2198', '383', '30000', '','0'); -- id=2200
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-34714330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '89', supplierdebtchangebefore = '58000.00', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '28000.00', supplierdebtchangedate = '2026-10-12 20:26:05', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2198',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='58000',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='28000', paySerialNo='64',tagids='' WHERE supplierdebtchangeid = '412';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:26:16', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=8140
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:26:17', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=8141
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:17";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:26:17', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=8142
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:19";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:26:19', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8143
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:26:31', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=8144
BEGIN;
CALL supplierInUse(88,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('88', '120400.00', '30000', '1', 'ايصال دفع لمورد', '1', '90400', '2026-10-12 20:26:19', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','65',''); -- id=413
UPDATE supplierdebtchange SET supplierid = '88', supplierdebtchangebefore = '120400.00', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '90400', supplierdebtchangedate = '2026-10-12 20:26:19', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='120400',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='90400', paySerialNo='65',tagids='' WHERE supplierdebtchangeid = '413';
UPDATE supplier SET  suppliercurrentDebt = '90400',suppliercurrentDebtInCurrency= '90400' , userid = '1', supplierdate = '2026-10-12 20:26:31'   WHERE supplierid = '88';
UPDATE supplier SET  inUse = 0 where supplierid = 88;
UPDATE save SET  savecurrentvalue = '-34744330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34714330.00','30000', '1', '1', 'ايصال دفع لمورد', '413', '-34744330', '2026-10-12 20:26:31', '1',  'supplierPayedDeptController.php','0','','0'); -- id=579
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-12', '1', '0', '0', '2026-10-12 20:26:31','ايصال دفع لمورد ( بيدو الالماني ) ','1','0','0','0','413','supplierReportsController.php?do=show&id=413'); -- id=2199
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2199', '569', '30000', '','0'); -- id=2243
UPDATE accountstree SET name = 'بيدو الالماني', customName = 'بيدو الالماني', customNameEn = 'بيدو الالماني', nameEn = 'بيدو الالماني', parent = '81', accountNature = '1', theValue = '90400', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 16:49:11' WHERE id = '569';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2199', '383', '30000', '','0'); -- id=2201
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-34744330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '88', supplierdebtchangebefore = '120400.00', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '90400.00', supplierdebtchangedate = '2026-10-12 20:26:19', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2199',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='120400',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='90400', paySerialNo='65',tagids='' WHERE supplierdebtchangeid = '413';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:26:31', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=8145
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:26:33', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=8146
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:26:33', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=8147
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:56:37";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:26:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-12 20:26:37', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php'); -- id=8148
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:57:01";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:27:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-12 20:27:01', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php?do=add'); -- id=8149

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =597
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(10,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '379735' , clientdate = '2026-10-12 20:27:01', userid = '1' WHERE clientid = '10';
UPDATE client SET  inUse = 0 where clientid = 10;
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 ('10','479735.00','100000','1','ايصال تحصيل (( قبض من عميل ))','597', '379735', '2026-10-12 20:26:37', '1', 'clientPayedDeptController.php', '   ', '100000', '0', null, '0', null, null,'', '-1','1','1','100000','1','','488','0','','.'); -- id=597
UPDATE save SET  savecurrentvalue = '-34644330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34744330.00','100000', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '597', '-34644330', '2026-10-12 20:27:01', '1',  'clientPayedDeptController.php','10','','0'); -- id=580
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '100000', '100000', '2026-10-12', '1', '0', '0', '2026-10-12 20:27:01','اضافة ايصال سداد للعميل حسن العناني - العملاء','1','0','0','0','597','clientPayedDeptController.php?do=show&id=597'); -- id=2200
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2200', '383', '100000', '','0'); -- id=2244
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-34644330', 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 ('2200', '508', '100000', '','0'); -- id=2202
UPDATE accountstree SET name = 'حسن العناني - العملاء', customName = 'حسن العناني - العملاء', customNameEn = 'حسن العناني - العملاء', nameEn = 'حسن العناني - العملاء', parent = '58', accountNature = '0', theValue = '-100000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2026-10-01 21:23:05' WHERE id = '508';
UPDATE clientdebtchange SET clientid = '10', clientdebtchangebefore = '479735.000', clientdebtchangeamount = '100000.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '597', clientdebtchangeafter = '379735.000', clientdebtchangedate = '2026-10-12 20:26:37', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '100000.000',discount='', reciptid='0', dailyentryid = '2200',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='100000',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '597';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:57:01";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:27:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-12 20:27:01', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=8150
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:57:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:27:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-12 20:27:03', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php?do=show'); -- id=8151
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:57:04";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:27:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-12 20:27:04', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php'); -- id=8152
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:58:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:28:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-12 20:28:45', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php?do=add'); -- id=8153

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =598
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(45,@clientdebt,@clientname,@treeIdis);
UPDATE client SET  clientdebt = '187740.6' , clientdate = '2026-10-12 20:28:45', userid = '1' WHERE clientid = '45';
UPDATE client SET  inUse = 0 where clientid = 45;
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 ('45','287740.60','100000','1','ايصال تحصيل (( قبض من عميل ))','598', '187740.6', '2026-10-12 20:27:04', '1', 'clientPayedDeptController.php', '   ', '100000', '0', null, '0', null, null,'', '-1','1','1','100000','1','','489','0','','.'); -- id=598
UPDATE save SET  savecurrentvalue = '-34544330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34644330.00','100000', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '598', '-34544330', '2026-10-12 20:28:45', '1',  'clientPayedDeptController.php','45','','0'); -- id=581
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '100000', '100000', '2026-10-12', '1', '0', '0', '2026-10-12 20:28:45','اضافة ايصال سداد للعميل عمر الطيب - عميل','1','0','0','0','598','clientPayedDeptController.php?do=show&id=598'); -- id=2201
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2201', '383', '100000', '','0'); -- id=2245
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-34544330', 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 ('2201', '543', '100000', '','0'); -- id=2203
UPDATE accountstree SET name = 'عمر الطيب - عميل', customName = 'عمر الطيب - عميل', customNameEn = 'عمر الطيب - عميل', nameEn = 'عمر الطيب - عميل', parent = '58', accountNature = '0', theValue = '-100000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2026-10-01 21:23:06' WHERE id = '543';
UPDATE clientdebtchange SET clientid = '45', clientdebtchangebefore = '287740.600', clientdebtchangeamount = '100000.000', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '598', clientdebtchangeafter = '187740.600', clientdebtchangedate = '2026-10-12 20:27:04', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '100000.000',discount='', reciptid='0', dailyentryid = '2201',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='100000',saveConversionFactor='1',totalpayments='0',tagids='',file='.' WHERE clientdebtchangeid = '598';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:58:45";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:28:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-12 20:28:45', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php?do=sucess'); -- id=8154
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:58:47";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:28:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-12 20:28:47', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php?do=show'); -- id=8155
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:59:05";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:29:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-12 20:29:05', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php'); -- id=8156
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:59:06";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:29:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:29:06', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8157
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:59:18";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:29:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 20:29:18', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php'); -- id=8158
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:59:34";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:29:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 20:29:34', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=add'); -- id=8159
INSERT INTO supplier (suppliername, supplieraddress, supplierphone, suppliercurrentDebt, supplierdetails, conditions, userid, supplierdate, dailyentryid, category_id, typesupplier_id,linkedClientId,inUse,suppliercode,goverareaid,namepayeecheck,suppliermobile,warrantyOfficer,warrantymobile,sellername,sellermobile,taxnumber,supplierTypeForTree,treeId,sullpierCurrencyid,suppliercurrentDebtInCurrency,webApiId,shippingDiscountPer) VALUES ('مصطفي زورو', '', '', '0', '', '0', '1', '2026-10-12 20:29:34', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=162
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 ('162', '0', '0', '0', 'إضافة مورد جديد', '162', '0', '2026-10-12 20:29:34', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=414
UPDATE client SET clientname = '', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '', clientdetails = '', conditions = null, clientdate = '', userid = null  , clientareaid = null  ,clientcode = '',dailyentryid = null , rondomtxt = '',clientStoreIds = '', obygyPatientId = '0' , debtLimit='0' , typeclientid='',priceTypeId='0',lastEditUser = '0',card_number = '0',file_faida = '',specialDiscount = '0',specialDiscountVal = '0',file = '',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '162',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='0',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='0',datecustomeraccount='',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='' WHERE clientid = null;
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مصطفي زورو', 'مصطفي زورو', 'مصطفي زورو', 'مصطفي زورو', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-10-12 20:29:34'); -- id=645
UPDATE supplier SET suppliername = 'مصطفي زورو', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-12', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='645',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '162';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:59:34";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:29:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 20:29:34', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=sucess'); -- id=8160
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:59:36";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:29:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 20:29:36', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=8161
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:59:39";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:29:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:29:39', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8162
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:59:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:29:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:29:51', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=8163
BEGIN;
CALL supplierInUse(162,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('162', '0.00', '200000', '1', 'ايصال دفع لمورد', '1', '-200000', '2026-10-12 20:29:39', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','200000','1','0','0','0','66',''); -- id=415
UPDATE supplierdebtchange SET supplierid = '162', supplierdebtchangebefore = '0.00', supplierdebtchangeamount = '200000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '-200000', supplierdebtchangedate = '2026-10-12 20:29:39', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='200000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='0',debtchangamountInSupplierCurrency='200000',debtchangafterInSupplierCurrency='-200000', paySerialNo='66',tagids='' WHERE supplierdebtchangeid = '415';
UPDATE supplier SET  suppliercurrentDebt = '-200000',suppliercurrentDebtInCurrency= '-200000' , userid = '1', supplierdate = '2026-10-12 20:29:51'   WHERE supplierid = '162';
UPDATE supplier SET  inUse = 0 where supplierid = 162;
UPDATE save SET  savecurrentvalue = '-34744330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34544330.00','200000', '1', '1', 'ايصال دفع لمورد', '415', '-34744330', '2026-10-12 20:29:51', '1',  'supplierPayedDeptController.php','0','','0'); -- id=582
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '200000', '200000', '2026-10-12', '1', '0', '0', '2026-10-12 20:29:51','ايصال دفع لمورد ( مصطفي زورو ) ','1','0','0','0','415','supplierReportsController.php?do=show&id=415'); -- id=2202
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2202', '645', '200000', '','0'); -- id=2246
UPDATE accountstree SET name = 'مصطفي زورو', customName = 'مصطفي زورو', customNameEn = 'مصطفي زورو', nameEn = 'مصطفي زورو', parent = '81', accountNature = '1', theValue = '-200000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 20:29:34' WHERE id = '645';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2202', '383', '200000', '','0'); -- id=2204
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-34744330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '162', supplierdebtchangebefore = '0.00', supplierdebtchangeamount = '200000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '-200000.00', supplierdebtchangedate = '2026-10-12 20:29:39', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2202',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='200000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='0',debtchangamountInSupplierCurrency='200000',debtchangafterInSupplierCurrency='-200000', paySerialNo='66',tagids='' WHERE supplierdebtchangeid = '415';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:59:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:29:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:29:51', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=8164
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:59:52";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:29:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:29:52', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=8165
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:59:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:29:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:29:53', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=8166
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 16:59:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:29:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:29:58', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8167
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:30:07', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=8168
BEGIN;
CALL supplierInUse(161,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('161', '858325.00', '400000', '1', 'ايصال دفع لمورد', '1', '458325', '2026-10-12 20:29:58', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','400000','1','0','0','0','67',''); -- id=416
UPDATE supplierdebtchange SET supplierid = '161', supplierdebtchangebefore = '858325.00', supplierdebtchangeamount = '400000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '458325', supplierdebtchangedate = '2026-10-12 20:29:58', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='400000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='858325',debtchangamountInSupplierCurrency='400000',debtchangafterInSupplierCurrency='458325', paySerialNo='67',tagids='' WHERE supplierdebtchangeid = '416';
UPDATE supplier SET  suppliercurrentDebt = '458325',suppliercurrentDebtInCurrency= '458325' , userid = '1', supplierdate = '2026-10-12 20:30:07'   WHERE supplierid = '161';
UPDATE supplier SET  inUse = 0 where supplierid = 161;
UPDATE save SET  savecurrentvalue = '-35144330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-34744330.00','400000', '1', '1', 'ايصال دفع لمورد', '416', '-35144330', '2026-10-12 20:30:07', '1',  'supplierPayedDeptController.php','0','','0'); -- id=583
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '400000', '400000', '2026-10-12', '1', '0', '0', '2026-10-12 20:30:07','ايصال دفع لمورد ( الالماني ) ','1','0','0','0','416','supplierReportsController.php?do=show&id=416'); -- id=2203
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2203', '644', '400000', '','0'); -- id=2247
UPDATE accountstree SET name = 'الالماني', customName = 'الالماني', customNameEn = 'الالماني', nameEn = 'الالماني', parent = '81', accountNature = '1', theValue = '458325', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 18:57:07' WHERE id = '644';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2203', '383', '400000', '','0'); -- id=2205
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-35144330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '161', supplierdebtchangebefore = '858325.00', supplierdebtchangeamount = '400000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '458325.00', supplierdebtchangedate = '2026-10-12 20:29:58', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2203',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='400000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='858325',debtchangamountInSupplierCurrency='400000',debtchangafterInSupplierCurrency='458325', paySerialNo='67',tagids='' WHERE supplierdebtchangeid = '416';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:07";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:30:07', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=8169
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:09";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:30:09', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=8170
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:09";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:30:09', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=8171
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:30:13', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8172
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:29";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:30:29', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=8173
BEGIN;
CALL supplierInUse(59,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('59', '70266.00', '50000', '1', 'ايصال دفع لمورد', '1', '20266', '2026-10-12 20:30:13', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','50000','1','0','0','0','68',''); -- id=417
UPDATE supplierdebtchange SET supplierid = '59', supplierdebtchangebefore = '70266.00', supplierdebtchangeamount = '50000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '20266', supplierdebtchangedate = '2026-10-12 20:30:13', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='70266',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='20266', paySerialNo='68',tagids='' WHERE supplierdebtchangeid = '417';
UPDATE supplier SET  suppliercurrentDebt = '20266',suppliercurrentDebtInCurrency= '20266' , userid = '1', supplierdate = '2026-10-12 20:30:29'   WHERE supplierid = '59';
UPDATE supplier SET  inUse = 0 where supplierid = 59;
UPDATE save SET  savecurrentvalue = '-35194330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-35144330.00','50000', '1', '1', 'ايصال دفع لمورد', '417', '-35194330', '2026-10-12 20:30:29', '1',  'supplierPayedDeptController.php','0','','0'); -- id=584
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50000', '50000', '2026-10-12', '1', '0', '0', '2026-10-12 20:30:29','ايصال دفع لمورد ( بركان - مورد ) ','1','0','0','0','417','supplierReportsController.php?do=show&id=417'); -- id=2204
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2204', '478', '50000', '','0'); -- id=2248
UPDATE accountstree SET name = 'بركان - مورد', customName = 'بركان - مورد', customNameEn = 'بركان - مورد', nameEn = 'بركان - مورد', parent = '81', accountNature = '1', theValue = '-122444', 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 = '478';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2204', '383', '50000', '','0'); -- id=2206
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-35194330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '59', supplierdebtchangebefore = '70266.00', supplierdebtchangeamount = '50000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '20266.00', supplierdebtchangedate = '2026-10-12 20:30:13', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2204',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='70266',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='20266', paySerialNo='68',tagids='' WHERE supplierdebtchangeid = '417';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:29";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:30:29', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=8174
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:30:31', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=8175
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:30:31', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=8176
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:35";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:30:35', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8177
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 20:30:42', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php'); -- id=8178
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:50";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 20:30:50', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=add'); -- id=8179
INSERT INTO supplier (suppliername, supplieraddress, supplierphone, suppliercurrentDebt, supplierdetails, conditions, userid, supplierdate, dailyentryid, category_id, typesupplier_id,linkedClientId,inUse,suppliercode,goverareaid,namepayeecheck,suppliermobile,warrantyOfficer,warrantymobile,sellername,sellermobile,taxnumber,supplierTypeForTree,treeId,sullpierCurrencyid,suppliercurrentDebtInCurrency,webApiId,shippingDiscountPer) VALUES ('استوب', '', '', '0', '', '0', '1', '2026-10-12 20:30:50', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=163
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 ('163', '0', '0', '0', 'إضافة مورد جديد', '163', '0', '2026-10-12 20:30:50', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=418
UPDATE client SET clientname = '', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '', clientdetails = '', conditions = null, clientdate = '', userid = null  , clientareaid = null  ,clientcode = '',dailyentryid = null , rondomtxt = '',clientStoreIds = '', obygyPatientId = '0' , debtLimit='0' , typeclientid='',priceTypeId='0',lastEditUser = '0',card_number = '0',file_faida = '',specialDiscount = '0',specialDiscountVal = '0',file = '',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '163',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='0',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='0',datecustomeraccount='',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='' WHERE clientid = null;
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('استوب', 'استوب', 'استوب', 'استوب', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-10-12 20:30:50'); -- id=646
UPDATE supplier SET suppliername = 'استوب', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-12', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='646',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '163';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:50";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 20:30:50', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=sucess'); -- id=8180
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:52";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 20:30:52', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=8181
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:00:54";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:30:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 20:30:54', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php'); -- id=8182
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:01:14";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:31:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 20:31:14', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=add'); -- id=8183
INSERT INTO supplier (suppliername, supplieraddress, supplierphone, suppliercurrentDebt, supplierdetails, conditions, userid, supplierdate, dailyentryid, category_id, typesupplier_id,linkedClientId,inUse,suppliercode,goverareaid,namepayeecheck,suppliermobile,warrantyOfficer,warrantymobile,sellername,sellermobile,taxnumber,supplierTypeForTree,treeId,sullpierCurrencyid,suppliercurrentDebtInCurrency,webApiId,shippingDiscountPer) VALUES ('مصنع تبع شوقي', '', '', '0', '', '0', '1', '2026-10-12 20:31:14', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=164
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 ('164', '0', '0', '0', 'إضافة مورد جديد', '164', '0', '2026-10-12 20:31:14', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=419
UPDATE client SET clientname = '', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '', clientdetails = '', conditions = null, clientdate = '', userid = null  , clientareaid = null  ,clientcode = '',dailyentryid = null , rondomtxt = '',clientStoreIds = '', obygyPatientId = '0' , debtLimit='0' , typeclientid='',priceTypeId='0',lastEditUser = '0',card_number = '0',file_faida = '',specialDiscount = '0',specialDiscountVal = '0',file = '',mandobCollectRatio='0',webApiId ='0' ,clientRFID = '',linkedSupplierId = '164',postponeDays='0', studentid='0', taxnumber='', password='',clientTypeForTree='0',treeId='0',husbandNameObgy='',txtNameE='',facility='',delegate='',txtemail='',commercial='',valtaxnumber='',clientaddress2='',country='',delegateid='0',datecustomeraccount='',taxfile='',fileimg='',webStoreType='0',clientaddress3='',tagids='',email_verified='0',email_otp='0',email_otp_expiry='' WHERE clientid = null;
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('مصنع تبع شوقي', 'مصنع تبع شوقي', 'مصنع تبع شوقي', 'مصنع تبع شوقي', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-10-12 20:31:15'); -- id=647
UPDATE supplier SET suppliername = 'مصنع تبع شوقي', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-12', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='647',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '164';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:01:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:31:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 20:31:15', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=sucess'); -- id=8184
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:01:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:31:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-12 20:31:16', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=8185
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:01:21";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:31:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:31:21', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8186
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:01:35";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:31:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:31:35', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=8187
BEGIN;
CALL supplierInUse(164,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('164', '0.00', '50000', '1', 'ايصال دفع لمورد', '1', '-50000', '2026-10-12 20:31:21', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','50000','1','0','0','0','69',''); -- id=420
UPDATE supplierdebtchange SET supplierid = '164', supplierdebtchangebefore = '0.00', supplierdebtchangeamount = '50000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '-50000', supplierdebtchangedate = '2026-10-12 20:31:21', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='0',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='-50000', paySerialNo='69',tagids='' WHERE supplierdebtchangeid = '420';
UPDATE supplier SET  suppliercurrentDebt = '-50000',suppliercurrentDebtInCurrency= '-50000' , userid = '1', supplierdate = '2026-10-12 20:31:35'   WHERE supplierid = '164';
UPDATE supplier SET  inUse = 0 where supplierid = 164;
UPDATE save SET  savecurrentvalue = '-35244330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-35194330.00','50000', '1', '1', 'ايصال دفع لمورد', '420', '-35244330', '2026-10-12 20:31:35', '1',  'supplierPayedDeptController.php','0','','0'); -- id=585
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50000', '50000', '2026-10-12', '1', '0', '0', '2026-10-12 20:31:35','ايصال دفع لمورد ( مصنع تبع شوقي ) ','1','0','0','0','420','supplierReportsController.php?do=show&id=420'); -- id=2205
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2205', '647', '50000', '','0'); -- id=2249
UPDATE accountstree SET name = 'مصنع تبع شوقي', customName = 'مصنع تبع شوقي', customNameEn = 'مصنع تبع شوقي', nameEn = 'مصنع تبع شوقي', parent = '81', accountNature = '1', theValue = '-50000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 20:31:15' WHERE id = '647';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2205', '383', '50000', '','0'); -- id=2207
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-35244330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '164', supplierdebtchangebefore = '0.00', supplierdebtchangeamount = '50000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '-50000.00', supplierdebtchangedate = '2026-10-12 20:31:21', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2205',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='0',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='-50000', paySerialNo='69',tagids='' WHERE supplierdebtchangeid = '420';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:01:36";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:31:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:31:36', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=8188
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:01:37";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:31:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:31:37', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=8189
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:01:37";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:31:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:31:37', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=8190
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:01:40";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:31:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:31:40', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8191
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:01:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:31:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:31:51', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=8192
BEGIN;
CALL supplierInUse(78,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('78', '1071860.00', '50000', '1', 'ايصال دفع لمورد', '1', '1021860', '2026-10-12 20:31:40', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','50000','1','0','0','0','70',''); -- id=421
UPDATE supplierdebtchange SET supplierid = '78', supplierdebtchangebefore = '1071860.00', supplierdebtchangeamount = '50000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '1021860', supplierdebtchangedate = '2026-10-12 20:31:40', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='1071860',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='1021860', paySerialNo='70',tagids='' WHERE supplierdebtchangeid = '421';
UPDATE supplier SET  suppliercurrentDebt = '1021860',suppliercurrentDebtInCurrency= '1021860' , userid = '1', supplierdate = '2026-10-12 20:31:51'   WHERE supplierid = '78';
UPDATE supplier SET  inUse = 0 where supplierid = 78;
UPDATE save SET  savecurrentvalue = '-35294330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-35244330.00','50000', '1', '1', 'ايصال دفع لمورد', '421', '-35294330', '2026-10-12 20:31:51', '1',  'supplierPayedDeptController.php','0','','0'); -- id=586
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50000', '50000', '2026-10-12', '1', '0', '0', '2026-10-12 20:31:51','ايصال دفع لمورد ( احمد الكاشف ) ','1','0','0','0','421','supplierReportsController.php?do=show&id=421'); -- id=2206
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2206', '504', '50000', '','0'); -- id=2250
UPDATE accountstree SET name = 'احمد الكاشف', customName = 'احمد الكاشف', customNameEn = 'احمد الكاشف', nameEn = 'احمد الكاشف', parent = '81', accountNature = '1', theValue = '1021860', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-01 19:10:02' WHERE id = '504';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2206', '383', '50000', '','0'); -- id=2208
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-35294330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '78', supplierdebtchangebefore = '1071860.00', supplierdebtchangeamount = '50000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '1021860.00', supplierdebtchangedate = '2026-10-12 20:31:40', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2206',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='1071860',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='1021860', paySerialNo='70',tagids='' WHERE supplierdebtchangeid = '421';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:01:51";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:31:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:31:51', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=8193
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:01:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:31:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:31:53', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=8194
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:01:53";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:31:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:31:53', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=8195
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:02:41";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:32:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:32:41', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8196
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:02:54";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:32:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:32:54', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=8197
BEGIN;
CALL supplierInUse(163,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('163', '0.00', '200000', '1', 'ايصال دفع لمورد', '1', '-200000', '2026-10-12 20:32:41', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','200000','1','0','0','0','71',''); -- id=422
UPDATE supplierdebtchange SET supplierid = '163', supplierdebtchangebefore = '0.00', supplierdebtchangeamount = '200000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '-200000', supplierdebtchangedate = '2026-10-12 20:32:41', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='200000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='0',debtchangamountInSupplierCurrency='200000',debtchangafterInSupplierCurrency='-200000', paySerialNo='71',tagids='' WHERE supplierdebtchangeid = '422';
UPDATE supplier SET  suppliercurrentDebt = '-200000',suppliercurrentDebtInCurrency= '-200000' , userid = '1', supplierdate = '2026-10-12 20:32:54'   WHERE supplierid = '163';
UPDATE supplier SET  inUse = 0 where supplierid = 163;
UPDATE save SET  savecurrentvalue = '-35494330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-35294330.00','200000', '1', '1', 'ايصال دفع لمورد', '422', '-35494330', '2026-10-12 20:32:54', '1',  'supplierPayedDeptController.php','0','','0'); -- id=587
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '200000', '200000', '2026-10-12', '1', '0', '0', '2026-10-12 20:32:54','ايصال دفع لمورد ( استوب ) ','1','0','0','0','422','supplierReportsController.php?do=show&id=422'); -- id=2207
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2207', '646', '200000', '','0'); -- id=2251
UPDATE accountstree SET name = 'استوب', customName = 'استوب', customNameEn = 'استوب', nameEn = 'استوب', parent = '81', accountNature = '1', theValue = '-200000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 20:30:50' WHERE id = '646';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2207', '383', '200000', '','0'); -- id=2209
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-35494330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '163', supplierdebtchangebefore = '0.00', supplierdebtchangeamount = '200000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '-200000.00', supplierdebtchangedate = '2026-10-12 20:32:41', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2207',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='200000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='0',debtchangamountInSupplierCurrency='200000',debtchangafterInSupplierCurrency='-200000', paySerialNo='71',tagids='' WHERE supplierdebtchangeid = '422';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:02:54";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:32:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:32:54', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=8198
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:02:56";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:32:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:32:56', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=8199
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:02:56";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:32:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:32:56', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=8200
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:03:00";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:33:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:33:00', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8201
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:03:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:33:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:33:13', '1', 'add', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=8202
BEGIN;
CALL supplierInUse(11,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('11', '217162.00', '50000', '1', 'ايصال دفع لمورد', '1', '167162', '2026-10-12 20:33:00', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','50000','1','0','0','0','72',''); -- id=423
UPDATE supplierdebtchange SET supplierid = '11', supplierdebtchangebefore = '217162.00', supplierdebtchangeamount = '50000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '167162', supplierdebtchangedate = '2026-10-12 20:33:00', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='217162',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='167162', paySerialNo='72',tagids='' WHERE supplierdebtchangeid = '423';
UPDATE supplier SET  suppliercurrentDebt = '167162',suppliercurrentDebtInCurrency= '167162' , userid = '1', supplierdate = '2026-10-12 20:33:13'   WHERE supplierid = '11';
UPDATE supplier SET  inUse = 0 where supplierid = 11;
UPDATE save SET  savecurrentvalue = '-35544330',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-35494330.00','50000', '1', '1', 'ايصال دفع لمورد', '423', '-35544330', '2026-10-12 20:33:13', '1',  'supplierPayedDeptController.php','0','','0'); -- id=588
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50000', '50000', '2026-10-12', '1', '0', '0', '2026-10-12 20:33:13','ايصال دفع لمورد ( الاسباني - مورد ) ','1','0','0','0','423','supplierReportsController.php?do=show&id=423'); -- id=2208
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2208', '430', '50000', '','0'); -- id=2252
UPDATE accountstree SET name = 'الاسباني - مورد', customName = 'الاسباني - مورد', customNameEn = 'الاسباني - مورد', nameEn = 'الاسباني - مورد', parent = '81', accountNature = '1', theValue = '28234', 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 = '430';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2208', '383', '50000', '','0'); -- id=2210
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-35544330', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '11', supplierdebtchangebefore = '217162.00', supplierdebtchangeamount = '50000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '167162.00', supplierdebtchangedate = '2026-10-12 20:33:00', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '2208',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='217162',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='167162', paySerialNo='72',tagids='' WHERE supplierdebtchangeid = '423';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:03:13";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:33:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:33:13', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=8203
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:03:14";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:33:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:33:14', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=8204
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:03:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:33:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-12 20:33:15', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=8205
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:05:25";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:35:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:35:25', '1', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8206
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:05:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:35:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:35:58', '1', 'addAndRetuen', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=8207

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06acd1a5dab3e6
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-12 20:35:58', '06acd1a5dab3e6', '1', '0.00', '0', '0', '1', '2370.00', '2370', '2370', '0', '1', '2026-10-12 20:35:58', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2370','0','','0','0','2370','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-12','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=463
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','اضافة فاتورة مبيعات','463', '0', '2026-10-12 20:35:58', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2370', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 20:35:58','0','0','',''); -- id=599
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 985;
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 ('364','i0001891', '463', '147', '1891', '6', '395', '2370', '0', '', '0', '2026-10-12 20:35:58', '1891', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','985-6,','1','1','0','0','395','2370','0','','0','0.00','0','0','0','0'); -- id=1615
UPDATE sellbilldetail SET  lastbuyprice = 364.00 , meanbuyprice = 364.00, lastbuyprice_withDiscount = 364.00, meanbuyprice_withDiscount = 364.00
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where sellbilldetailid = 1615;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1891, '2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '318', userid = '1', storedetaildate = '2026-10-12 20:35:58' WHERE storedetailid = '2908';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1891', '1', '6', '1', '463', 'اضافة فاتورة مبيعات', 'sellbillController.php', '324', '318', '1', '2026-10-12 20:35:58','0','0'); -- id=4928
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-35541958',  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 ('-35544328','2370', '0', '1', 'اضافة فاتورة مبيعات', '463', '-35541958', '2026-10-12 20:35:58', '1',  'sellbillController.php','1','','0'); -- id=589
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2370', '2370', '2026-10-12', '1', '0', '0', '2026-10-12 20:35:58','اضافة فاتورة مبيعات رقم 463','1','0',null,'0','463','sellbillController.php?do=showDetail&sellbillid=463'); -- id=2209
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2209', '383', '2370', '','0'); -- id=2253
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-35541960', 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 ('2209', '143', '2370', '','0'); -- id=2211
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4574460', 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 ( '2184', '2184', '2026-10-12', '1', '0', '0', '2026-10-12 20:35:58','اضافة فاتورة مبيعات رقم 463 - صرف البضاعة من المخزن','1','0',null,'0','463','sellbillController.php?do=showDetail&sellbillid=463'); -- id=2210
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2210', '402', '2184', '','0'); -- id=2254
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4273682.07', 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 ('2210', '382', '2184', '','0'); -- id=2212
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '21291606.63', 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='2209,0,2210' where sellbillid=463;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2370, sellCostBuyPrice =sellCostBuyPrice+2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2184
                        , returnSellVal = returnSellVal+0, 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, 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184, 2184, 2184)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2370, netSellCostBuyPrice = netSellCostBuyPrice+2184
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2184
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2184
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2184
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2184
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2184
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2184
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2184;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06acd1a5dab3e6 and sellbillId = 463 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:05:58";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:35:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:35:58', '1', 'addsellBill', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=8208
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:06:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:36:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:36:33', '1', 'showDetail', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=463'); -- id=8209
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:08:02";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:38:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:38:02', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=8210
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:08:04";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:38:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:38:04', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=8211
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:08:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:38:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:38:22', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=8212
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:08:35";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:38:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:38:35', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=8213
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:09:03";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:39:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:39:03', '1', 'showDetail', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=462'); -- id=8214
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:09:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:39:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 20:39:16', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=8215
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:09:16";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 20:39:16', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=8216
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:09:16";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:39:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-12 20:39:16', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=8217
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
UPDATE product
                JOIN (
                       select productingredients.productId
                              ,sum(productnumber * quantity * productBuyPrice) as productBuyPrice
                              ,sum(productnumber * quantity * lastbuyprice) as lastbuyprice
                              ,sum(productnumber * quantity * lastbuyprice_withDiscount) as lastbuyprice_withDiscount
                              ,sum(productnumber * quantity * meanbuyprice) as meanbuyprice
                              ,sum(productnumber * quantity * meanbuyprice_withDiscount) as meanbuyprice_withDiscount
                              ,sum(productnumber * quantity * overAllAveragePrice) as overAllAveragePrice
                      from product
                      join productingredients on product.productId = productingredients.ingridientId
                      join productunit on productunit.productunitid = productingredients.unitId
                      group by productingredients.productId
                    ) as ingridientPrice ON ingridientPrice.productId =  product.productId
                SET product.productBuyPrice = ingridientPrice.productBuyPrice,
                        product.lastbuyprice = ingridientPrice.lastbuyprice,
                    product.lastbuyprice_withDiscount = ingridientPrice.lastbuyprice_withDiscount,
                    product.meanbuyprice = ingridientPrice.meanbuyprice,
                    product.meanbuyprice_withDiscount = ingridientPrice.meanbuyprice_withDiscount,
                    product.overAllAveragePrice = ingridientPrice.overAllAveragePrice;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:09:16";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-12 20:39:16', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=8218
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:09:23";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:39:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:39:23', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=8219
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:09:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:39:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:39:33', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=8220
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:10:14";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:40:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:40:14', '1', 'delete', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=delete&sellbillid=462&action=2191,0,2192'); -- id=8221

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 462
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 462;
UPDATE dailyentry SET totalcreditor = '2370.00', totaldebtor = '2370.00', thedate = '2026-10-12', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-12 20:21:02', entryComment = 'اضافة فاتورة مبيعات رقم 462', fromFlag = '1',related='0',isopeningentry='0',operationId='462',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=462' WHERE id = '2191';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2370.00', '2370.00', '2026-10-12', '1', '0', '2191', '2026-10-12 20:40:14','تم عكس القيد رقم 2191 ','1','0','0','0','0',''); -- id=2211
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2211', '419', '2370.00', '','0'); -- id=2213
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2667725', 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 ('2211', '143', '2370.00', '','0'); -- id=2255
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4572090', 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 = '2184.00', totaldebtor = '2184.00', thedate = '2026-10-12', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-12 20:21:02', entryComment = 'اضافة فاتورة مبيعات رقم 462 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='462',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=462' WHERE id = '2192';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2184.00', '2184.00', '2026-10-12', '1', '0', '2192', '2026-10-12 20:40:14','تم عكس القيد رقم 2192 ','1','0','0','0','0',''); -- id=2212
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2212', '402', '2184.00', '','0'); -- id=2214
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4271498.07', 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 ('2212', '382', '2184.00', '','0'); -- id=2256
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '21293790.63', 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  sellbillsysdate = '2026-10-12 20:40:14', userid = '2',delbyuserid = '1', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '462';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 985;
UPDATE sellbilldetail SET  lastbuyprice = 364.00 , meanbuyprice = 364.00, lastbuyprice_withDiscount = 364.00, meanbuyprice_withDiscount = 364.00
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where sellbilldetailid = 1614;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1891, '2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2370, sellCostBuyPrice =sellCostBuyPrice-2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2184
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2370, sellCostBuyPrice =sellCostBuyPrice-2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2184
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '324', userid = '1', storedetaildate = '2026-10-12 20:40:14' WHERE storedetailid = '2908';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1891', '1', '6', '0', '462', 'حذف فاتورة مبيعات', 'sellbillController.php', '318', '324', '1', '2026-10-12 20:40:14','0','0'); -- id=4929
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','حذف فاتورة مبيعات','462', '0', '2026-10-12 20:40:14', '1', 'sellbillController.php', 'حذف فاتورة مبيعات', '2370', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 20:21:02','0','0','',''); -- id=600
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2667725',  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 ('2670095','2370', '1', '2', 'حذف فاتورة مبيعات', '462', '2667725', '2026-10-12 20:40:14', '1',  'sellbillController.php','1','','0'); -- id=590
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2370, sellCostBuyPrice =sellCostBuyPrice-2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2184
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2370, sellCostBuyPrice =sellCostBuyPrice-2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2184
                        , returnSellVal = returnSellVal-0, 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, 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184, 2184, 2184)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-2370, netSellCostBuyPrice = netSellCostBuyPrice-2184
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-2184
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-2184
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-2184
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-2184
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-2184
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-2184
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-2184;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 462
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:10:14";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:40:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:40:14', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=sucess'); -- id=8222
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:10:15";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:40:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:40:15', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=8223
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:10:22";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:40:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:40:22', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=8224
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:10:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:40:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:40:31', '1', 'delete', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=delete&sellbillid=461&action=2189,0,2190'); -- id=8225

-- ----------------------------------------------------------------------------------------------------
-- bill delete start - sellbill with id = 461
-- ----------------------------------------------------------------------------------------------------

BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 461;
UPDATE dailyentry SET totalcreditor = '2370.00', totaldebtor = '2370.00', thedate = '2026-10-12', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-12 20:19:22', entryComment = 'اضافة فاتورة مبيعات رقم 461', fromFlag = '1',related='0',isopeningentry='0',operationId='461',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=461' WHERE id = '2189';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2370.00', '2370.00', '2026-10-12', '1', '0', '2189', '2026-10-12 20:40:31','تم عكس القيد رقم 2189 ','1','0','0','0','0',''); -- id=2213
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2213', '419', '2370.00', '','0'); -- id=2215
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '2665355', 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 ('2213', '143', '2370.00', '','0'); -- id=2257
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '4569720', 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 = '2184.00', totaldebtor = '2184.00', thedate = '2026-10-12', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-12 20:19:22', entryComment = 'اضافة فاتورة مبيعات رقم 461 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='461',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=461' WHERE id = '2190';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2184.00', '2184.00', '2026-10-12', '1', '0', '2190', '2026-10-12 20:40:31','تم عكس القيد رقم 2190 ','1','0','0','0','0',''); -- id=2214
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('2214', '402', '2184.00', '','0'); -- id=2216
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '4269314.07', 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 ('2214', '382', '2184.00', '','0'); -- id=2258
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '21295974.63', 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  sellbillsysdate = '2026-10-12 20:40:31', userid = '2',delbyuserid = '1', conditions = '1'  ,billReservation= 0,billReservationDate='0000-00-00'  WHERE sellbillid = '461';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 985;
UPDATE sellbilldetail SET  lastbuyprice = 364.00 , meanbuyprice = 364.00, lastbuyprice_withDiscount = 364.00, meanbuyprice_withDiscount = 364.00
        , lastbuyprice_withTax = 364, meanbuyprice_withTax = 364, lastbuyprice_withDiscountAndTax = 364
                where sellbilldetailid = 1613;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1891, '2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2370, sellCostBuyPrice =sellCostBuyPrice-2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2184
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2370, sellCostBuyPrice =sellCostBuyPrice-2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2184
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '330', userid = '1', storedetaildate = '2026-10-12 20:40:31' WHERE storedetailid = '2908';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1891', '1', '6', '0', '461', 'حذف فاتورة مبيعات', 'sellbillController.php', '324', '330', '1', '2026-10-12 20:40:31','0','0'); -- id=4930
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','حذف فاتورة مبيعات','461', '0', '2026-10-12 20:40:31', '1', 'sellbillController.php', 'حذف فاتورة مبيعات', '2370', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-12 20:19:22','0','0','',''); -- id=601
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '2665355',  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 ('2667725','2370', '1', '2', 'حذف فاتورة مبيعات', '461', '2665355', '2026-10-12 20:40:31', '1',  'sellbillController.php','1','','0'); -- id=591
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2370, sellCostBuyPrice =sellCostBuyPrice-2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2184
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-12', 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2184, 2184, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2370, sellCostBuyPrice =sellCostBuyPrice-2184
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2184, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2184
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2184, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2184
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2184
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2184
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2184
                        , returnSellVal = returnSellVal-0, 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, 2370, 2184, 2184
                    , 2184, 2184, 2184, 2184, 2184, 2184)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-2370, netSellCostBuyPrice = netSellCostBuyPrice-2184
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-2184
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-2184
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-2184
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-2184
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-2184
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-2184
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-2184;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill delete end - sellbill with id = 461
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:10:31";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:40:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:40:31', '1', 'sucess', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=sucess'); -- id=8226
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:10:33";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:40:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-12 20:40:33', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=8227
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:11:54";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:41:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-12 20:41:54', '1', '', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=8228
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:13:42";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:43:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnsellbillController.php', '2026-10-12 20:43:42', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnsellbillController.php?do=show'); -- id=8229
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-12 17:13:59";
UPDATE user SET loginip = "156.196.18.158", lastactivetime = "2026-10-12 20:43:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnsellbillController.php', '2026-10-12 20:43:59', '1', 'show', '156.196.18.158', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnsellbillController.php?do=show'); -- id=8230
