[2026-09-12 08:00:57] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-11","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 08:00:57] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-11"} 
[2026-09-12 08:00:57] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-11')"} 
[2026-09-12 08:00:57] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-11') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and (`purchase`.`type` = ? or (`purchase`.`type` != ? and date(transaction_date) <= '2026-09-11'))","bindings":["purchase_order",43,"opening_stock","opening_stock"]} 
[2026-09-12 08:00:57] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"8844862.43600000","is_opening":true,"date":"2026-09-11"} 
[2026-09-12 08:00:57] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-12","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 08:00:57] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-12' (includes all types except purchase_order)"} 
[2026-09-12 08:00:57] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-12') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and date(transaction_date) <= '2026-09-12'","bindings":["purchase_order",43]} 
[2026-09-12 08:00:57] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"8844862.43600000","is_opening":false,"date":"2026-09-12"} 
[2026-09-12 08:00:59] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:01:14] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:01:19] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:01:50] live.INFO: === About to call saveProductNewUnitRelationships === {"product_id":344,"request_units":[{"actual_name":"pieces","unit_id":"267","short_name":"pcs","relation_unit_id":null,"relation_qty":"1","price":"20"}],"page_batch_id":"20260912_080116_9953"} 
[2026-09-12 08:01:50] live.INFO: === saveProductNewUnitRelationships START === {"product_id":344,"product_name":"Default"} 
[2026-09-12 08:01:50] live.INFO: Units data received {"units_data":[{"actual_name":"pieces","unit_id":"267","short_name":"pcs","relation_unit_id":null,"relation_qty":"1","price":"20"}],"count":1} 
[2026-09-12 08:01:50] live.INFO: Processing unit index: 0 {"unit_data":{"actual_name":"pieces","unit_id":"267","short_name":"pcs","relation_unit_id":null,"relation_qty":"1","price":"20"}} 
[2026-09-12 08:01:50] live.INFO: Unit found by ID {"unit_id":267,"actual_name":"pieces"} 
[2026-09-12 08:01:50] live.INFO: Unit lookup result {"found":"yes","unit_id":267,"method":"by_id"} 
[2026-09-12 08:01:50] live.INFO: Updating existing unit {"unit_id":267} 
[2026-09-12 08:01:50] live.INFO: Updated unit_price {"new_price":20.0} 
[2026-09-12 08:01:50] live.INFO: Unit updated successfully  
[2026-09-12 08:01:50] live.INFO: Setting as BASE unit {"unit_id":267} 
[2026-09-12 08:01:50] live.INFO: Base unit saved {"base_unit_id":267} 
[2026-09-12 08:01:50] live.INFO: First pass complete {"created_units_count":1,"base_unit_id":267} 
[2026-09-12 08:01:50] live.INFO: === SECOND PASS: Setting relations first ===  
[2026-09-12 08:01:50] live.INFO: === SECOND PASS: Calculating cumulative multipliers ===  
[2026-09-12 08:01:50] live.INFO: === saveProductNewUnitRelationships END ===  
[2026-09-12 08:01:51] live.INFO: OpeningStockController::add - Location Data {"product_id":"344","business_id":43,"locations":{"Illuminate\\Support\\Collection":{"39":"Greenfield Supermarket Ltd (BL0001)"}},"available_locations":[39]} 
[2026-09-12 08:01:51] live.INFO: OpeningStockController::add - Serial Numbers Check {"product_id":"344","business_id":43,"has_serial_numbers":{"39":false},"total_locations_with_serial":0} 
[2026-09-12 08:01:53] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:03:13] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:03:17] live.INFO: filterProduct method called {"business_id":43,"search_term":"de","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku"],"check_qty":false,"search_type":"like"} 
[2026-09-12 08:03:17] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 08:03:17] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 08:03:17] live.DEBUG: Applying search filters {"search_term":"de","search_type":"like","search_fields":["name","sku"]} 
[2026-09-12 08:03:17] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-12 08:03:17] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-12 08:03:17] live.INFO: filterProduct completed successfully {"result_count":2,"business_id":43,"search_term":"de"} 
[2026-09-12 08:03:25] live.INFO: Product Row Debug - RELOADED {"product_id":344,"product_name":"Default","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":12.5,"discounts_json":"[]","multiplier":1,"unit_prices":{"267":{"unit_id":267,"unit_name":"pieces","unit_price":20.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-12 08:03:25] live.INFO: Fetching tax rate for product ID: 344  
[2026-09-12 08:03:25] live.INFO: Product ID 344 has no tax assigned.  
[2026-09-12 08:03:31] live.INFO: filterProduct method called {"business_id":43,"search_term":"de","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku"],"check_qty":false,"search_type":"like"} 
[2026-09-12 08:03:31] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 08:03:31] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 08:03:31] live.DEBUG: Applying search filters {"search_term":"de","search_type":"like","search_fields":["name","sku"]} 
[2026-09-12 08:03:31] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-12 08:03:31] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-12 08:03:31] live.INFO: filterProduct completed successfully {"result_count":2,"business_id":43,"search_term":"de"} 
[2026-09-12 08:03:41] live.INFO: filterProduct method called {"business_id":43,"search_term":"def","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku"],"check_qty":false,"search_type":"like"} 
[2026-09-12 08:03:41] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 08:03:41] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 08:03:41] live.DEBUG: Applying search filters {"search_term":"def","search_type":"like","search_fields":["name","sku"]} 
[2026-09-12 08:03:41] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-12 08:03:41] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-12 08:03:41] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"def"} 
[2026-09-12 08:03:41] live.INFO: Fetching tax rate for product ID: 344  
[2026-09-12 08:03:41] live.INFO: Product ID 344 has no tax assigned.  
[2026-09-12 08:03:42] live.INFO: Fetching tax rate for product ID: 344  
[2026-09-12 08:03:42] live.INFO: Product ID 344 has no tax assigned.  
[2026-09-12 08:03:48] live.INFO: filterProduct method called {"business_id":43,"search_term":"de","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku"],"check_qty":false,"search_type":"like"} 
[2026-09-12 08:03:48] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 08:03:48] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 08:03:48] live.DEBUG: Applying search filters {"search_term":"de","search_type":"like","search_fields":["name","sku"]} 
[2026-09-12 08:03:48] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-12 08:03:48] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-12 08:03:48] live.INFO: filterProduct completed successfully {"result_count":2,"business_id":43,"search_term":"de"} 
[2026-09-12 08:03:59] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:04:04] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:06:32] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:06:39] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:16:38] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:26:38] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:32:29] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-11","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 08:32:29] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-11"} 
[2026-09-12 08:32:29] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-11')"} 
[2026-09-12 08:32:29] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-11') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and (`purchase`.`type` = ? or (`purchase`.`type` != ? and date(transaction_date) <= '2026-09-11'))","bindings":["purchase_order",43,"opening_stock","opening_stock"]} 
[2026-09-12 08:32:29] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"9144902.43600000","is_opening":true,"date":"2026-09-11"} 
[2026-09-12 08:32:29] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-12","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 08:32:29] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-12' (includes all types except purchase_order)"} 
[2026-09-12 08:32:29] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-12') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and date(transaction_date) <= '2026-09-12'","bindings":["purchase_order",43]} 
[2026-09-12 08:32:29] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"9144902.43600000","is_opening":false,"date":"2026-09-12"} 
[2026-09-12 08:32:31] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:42:29] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:43:55] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:44:32] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:44:35] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:44:54] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:45:02] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:45:14] live.INFO: === saveProductUnitRelationships START === {"product_id":344,"product_name":"Default"} 
[2026-09-12 08:45:14] live.INFO: Units data received {"units_data":[{"actual_name":"267","unit_id":"267","short_name":"pcs","allow_decimal":"1","relation_unit_id":null,"relation_qty":"1","price":"20.0000"}],"count":1} 
[2026-09-12 08:45:14] live.INFO: Processing unit index: 0 {"unit_data":{"actual_name":"267","unit_id":"267","short_name":"pcs","allow_decimal":"1","relation_unit_id":null,"relation_qty":"1","price":"20.0000"}} 
[2026-09-12 08:45:14] live.INFO: Unit found by ID {"unit_id":267,"actual_name":"pieces"} 
[2026-09-12 08:45:14] live.WARNING: Skipping actual_name update - value looks like an ID {"actual_name":"267","unit_id":267} 
[2026-09-12 08:45:14] live.INFO: Setting as BASE unit {"unit_id":267} 
[2026-09-12 08:45:14] live.INFO: Unit saved {"unit_id":267,"unit_name":"pieces","is_base":true} 
[2026-09-12 08:45:14] live.INFO: First pass complete {"created_units_count":1,"unit_ids_to_keep":[267],"base_unit_id":267} 
[2026-09-12 08:45:14] live.INFO: === SECOND PASS: Setting relations first ===  
[2026-09-12 08:45:14] live.INFO: === SECOND PASS: Calculating cumulative multipliers ===  
[2026-09-12 08:45:14] live.INFO: === Cleaning up unused units === {"unit_ids_to_keep":[267],"base_unit_id":267,"page_batch_id":"20260912_080116_9953"} 
[2026-09-12 08:45:14] live.INFO: Units to delete {"count":0,"unit_ids":[]} 
[2026-09-12 08:45:14] live.INFO: === saveProductUnitRelationships END ===  
[2026-09-12 08:45:15] live.INFO: OpeningStockController::add - Location Data {"product_id":"344","business_id":43,"locations":{"Illuminate\\Support\\Collection":{"39":"Greenfield Supermarket Ltd (BL0001)"}},"available_locations":[39]} 
[2026-09-12 08:45:15] live.INFO: OpeningStockController::add - Serial Numbers Check {"product_id":"344","business_id":43,"has_serial_numbers":{"39":true},"total_locations_with_serial":1} 
[2026-09-12 08:45:18] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:45:21] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:45:25] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:45:32] live.INFO: filterProduct method called {"business_id":43,"search_term":"de","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku"],"check_qty":false,"search_type":"like"} 
[2026-09-12 08:45:32] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 08:45:32] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 08:45:32] live.DEBUG: Applying search filters {"search_term":"de","search_type":"like","search_fields":["name","sku"]} 
[2026-09-12 08:45:32] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-12 08:45:32] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-12 08:45:32] live.INFO: filterProduct completed successfully {"result_count":2,"business_id":43,"search_term":"de"} 
[2026-09-12 08:45:34] live.INFO: Product Row Debug - RELOADED {"product_id":344,"product_name":"Default","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":12.5,"discounts_json":"[]","multiplier":1,"unit_prices":{"267":{"unit_id":267,"unit_name":"pieces","unit_price":20.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-12 08:45:35] live.INFO: Fetching tax rate for product ID: 344  
[2026-09-12 08:45:35] live.INFO: Product ID 344 has no tax assigned.  
[2026-09-12 08:45:51] live.INFO: filterProduct method called {"business_id":43,"search_term":"mil,","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku"],"check_qty":false,"search_type":"like"} 
[2026-09-12 08:45:51] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 08:45:51] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 08:45:51] live.DEBUG: Applying search filters {"search_term":"mil,","search_type":"like","search_fields":["name","sku"]} 
[2026-09-12 08:45:51] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-12 08:45:51] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-12 08:45:51] live.INFO: filterProduct completed successfully {"result_count":0,"business_id":43,"search_term":"mil,"} 
[2026-09-12 08:45:55] live.INFO: filterProduct method called {"business_id":43,"search_term":"mil","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku"],"check_qty":false,"search_type":"like"} 
[2026-09-12 08:45:55] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 08:45:55] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 08:45:55] live.DEBUG: Applying search filters {"search_term":"mil","search_type":"like","search_fields":["name","sku"]} 
[2026-09-12 08:45:55] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-12 08:45:55] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-12 08:45:55] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"mil"} 
[2026-09-12 08:45:56] live.INFO: Product Row Debug - RELOADED {"product_id":174,"product_name":"kinangop milk 250g","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":50.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"39":{"unit_id":39,"unit_name":"Pieces","unit_price":null,"multiplier":1,"has_price":false}},"has_price_group":false,"price_group_id":null} 
[2026-09-12 08:46:02] live.INFO: filterProduct method called {"business_id":43,"search_term":"de","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku"],"check_qty":false,"search_type":"like"} 
[2026-09-12 08:46:02] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 08:46:02] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 08:46:02] live.DEBUG: Applying search filters {"search_term":"de","search_type":"like","search_fields":["name","sku"]} 
[2026-09-12 08:46:02] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-12 08:46:02] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-12 08:46:02] live.INFO: filterProduct completed successfully {"result_count":2,"business_id":43,"search_term":"de"} 
[2026-09-12 08:46:03] live.INFO: Product Row Debug - RELOADED {"product_id":344,"product_name":"Default","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":12.5,"discounts_json":"[]","multiplier":1,"unit_prices":{"267":{"unit_id":267,"unit_name":"pieces","unit_price":20.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-12 08:46:04] live.INFO: Fetching tax rate for product ID: 344  
[2026-09-12 08:46:04] live.INFO: Product ID 344 has no tax assigned.  
[2026-09-12 08:46:18] live.INFO: Credit Limit Check Started {"contact_id":"703","status":"final","final_total":"13.00","is_credit_sale":"0","exclude_transaction_id":null} 
[2026-09-12 08:46:18] live.DEBUG: Payment Calculation {"final_total":13.0,"curr_total_payment":13.0,"is_credit_sale":false,"payment_count":1} 
[2026-09-12 08:46:18] live.INFO: Credit Limit Check Skipped - Fully Paid {"final_total":13.0,"curr_total_payment":13.0} 
[2026-09-12 08:46:18] live.INFO: mpesa_transaction_id value: NULL  
[2026-09-12 08:46:18] live.INFO: is_mpesa_sale value: true  
[2026-09-12 08:46:18] live.INFO: M-Pesa sale evaluation {"is_mpesa_sale_raw":true,"is_valid_mpesa_sale":false,"payment_method_input":"cash","mpesa_transaction_id":null,"transaction_id":1839} 
[2026-09-12 08:46:18] live.INFO: Journal Entry Case: FULL CASH PAYMENT {"transaction_id":1839,"final_total":13.0,"amount_paid":13.0,"balance_due":0} 
[2026-09-12 08:46:18] live.INFO: Journal Entries Inserted Successfully {"transaction_id":1839,"entries":[{"transaction_id":1839,"created_by_id":293,"transaction_number":"TRX-6aa4e72a8e0987.15981392","payment_detail_id":1317,"location_id":"39","currency_id":133,"transaction_type":"sell","date":"2026-09-12","month":9,"year":2026,"active":1,"reversed":0,"reversible":1,"manual_entry":1,"created_at":"2026-09-12 08:46:18","updated_at":"2026-09-12 08:46:18","chart_of_account_id":15441,"debit":null,"credit":13.0},{"transaction_id":1839,"created_by_id":293,"transaction_number":"TRX-6aa4e72a8e0987.15981392","payment_detail_id":1317,"location_id":"39","currency_id":133,"transaction_type":"sell","date":"2026-09-12","month":9,"year":2026,"active":1,"reversed":0,"reversible":1,"manual_entry":1,"created_at":"2026-09-12 08:46:18","updated_at":"2026-09-12 08:46:18","chart_of_account_id":15445,"debit":13.0,"credit":null}]} 
[2026-09-12 08:46:18] live.INFO: Inserted purchase sell mapping {"count":1,"data":[{"sell_line_id":1176,"purchase_line_id":1582,"quantity":1.0,"created_at":"2026-09-12 08:46:18","updated_at":"2026-09-12 08:46:18"}]} 
[2026-09-12 08:46:18] live.INFO: Inserted COGS → Inventory journal entries {"count":2} 
[2026-09-12 08:46:18] live.INFO: Inserted Retained Earnings (profit) entries {"count":1,"total_profit":3.0} 
[2026-09-12 08:46:18] live.ERROR: ETIMS settings not found for business ID: 43  
[2026-09-12 08:46:18] live.WARNING: ETIMS WAIT: Timed out after 2 attempts for transaction ID: 1839  
[2026-09-12 08:46:42] live.INFO: filterProduct method called {"business_id":43,"search_term":"milk","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku"],"check_qty":false,"search_type":"like"} 
[2026-09-12 08:46:42] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 08:46:42] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 08:46:42] live.DEBUG: Applying search filters {"search_term":"milk","search_type":"like","search_fields":["name","sku"]} 
[2026-09-12 08:46:42] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-12 08:46:42] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-12 08:46:42] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"milk"} 
[2026-09-12 08:46:43] live.INFO: Product Row Debug - RELOADED {"product_id":174,"product_name":"kinangop milk 250g","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":50.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"39":{"unit_id":39,"unit_name":"Pieces","unit_price":null,"multiplier":1,"has_price":false}},"has_price_group":false,"price_group_id":null} 
[2026-09-12 08:46:45] live.INFO: Credit Limit Check Started {"contact_id":"703","status":"final","final_total":"50.00","is_credit_sale":"0","exclude_transaction_id":null} 
[2026-09-12 08:46:45] live.DEBUG: Payment Calculation {"final_total":50.0,"curr_total_payment":50.0,"is_credit_sale":false,"payment_count":1} 
[2026-09-12 08:46:45] live.INFO: Credit Limit Check Skipped - Fully Paid {"final_total":50.0,"curr_total_payment":50.0} 
[2026-09-12 08:46:45] live.INFO: mpesa_transaction_id value: NULL  
[2026-09-12 08:46:45] live.INFO: is_mpesa_sale value: true  
[2026-09-12 08:46:45] live.INFO: M-Pesa sale evaluation {"is_mpesa_sale_raw":true,"is_valid_mpesa_sale":false,"payment_method_input":"cash","mpesa_transaction_id":null,"transaction_id":1840} 
[2026-09-12 08:46:45] live.INFO: Journal Entry Case: FULL CASH PAYMENT {"transaction_id":1840,"final_total":50.0,"amount_paid":50.0,"balance_due":0} 
[2026-09-12 08:46:45] live.INFO: Journal Entries Inserted Successfully {"transaction_id":1840,"entries":[{"transaction_id":1840,"created_by_id":293,"transaction_number":"TRX-6aa4e745646f63.03491208","payment_detail_id":1318,"location_id":"39","currency_id":133,"transaction_type":"sell","date":"2026-09-12","month":9,"year":2026,"active":1,"reversed":0,"reversible":1,"manual_entry":1,"created_at":"2026-09-12 08:46:45","updated_at":"2026-09-12 08:46:45","chart_of_account_id":15441,"debit":null,"credit":50.0},{"transaction_id":1840,"created_by_id":293,"transaction_number":"TRX-6aa4e745646f63.03491208","payment_detail_id":1318,"location_id":"39","currency_id":133,"transaction_type":"sell","date":"2026-09-12","month":9,"year":2026,"active":1,"reversed":0,"reversible":1,"manual_entry":1,"created_at":"2026-09-12 08:46:45","updated_at":"2026-09-12 08:46:45","chart_of_account_id":15445,"debit":50.0,"credit":null}]} 
[2026-09-12 08:46:45] live.INFO: Inserted purchase sell mapping {"count":1,"data":[{"sell_line_id":1177,"purchase_line_id":1322,"quantity":1.0,"created_at":"2026-09-12 08:46:45","updated_at":"2026-09-12 08:46:45"}]} 
[2026-09-12 08:46:45] live.INFO: Inserted COGS → Inventory journal entries {"count":2} 
[2026-09-12 08:46:45] live.INFO: Inserted Retained Earnings (profit) entries {"count":1,"total_profit":25.0} 
[2026-09-12 08:46:45] live.ERROR: ETIMS settings not found for business ID: 43  
[2026-09-12 08:46:45] live.WARNING: ETIMS WAIT: Timed out after 2 attempts for transaction ID: 1840  
[2026-09-12 08:46:56] live.INFO: filterProduct method called {"business_id":43,"search_term":"de","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku"],"check_qty":false,"search_type":"like"} 
[2026-09-12 08:46:56] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 08:46:56] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 08:46:56] live.DEBUG: Applying search filters {"search_term":"de","search_type":"like","search_fields":["name","sku"]} 
[2026-09-12 08:46:56] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-12 08:46:56] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-12 08:46:56] live.INFO: filterProduct completed successfully {"result_count":2,"business_id":43,"search_term":"de"} 
[2026-09-12 08:46:57] live.INFO: Product Row Debug - RELOADED {"product_id":344,"product_name":"Default","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":12.5,"discounts_json":"[]","multiplier":1,"unit_prices":{"267":{"unit_id":267,"unit_name":"pieces","unit_price":20.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-12 08:46:58] live.INFO: Fetching tax rate for product ID: 344  
[2026-09-12 08:46:58] live.INFO: Product ID 344 has no tax assigned.  
[2026-09-12 08:47:12] live.INFO: filterProduct method called {"business_id":43,"search_term":"de","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku"],"check_qty":false,"search_type":"like"} 
[2026-09-12 08:47:12] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 08:47:12] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 08:47:12] live.DEBUG: Applying search filters {"search_term":"de","search_type":"like","search_fields":["name","sku"]} 
[2026-09-12 08:47:12] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-12 08:47:12] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-12 08:47:12] live.INFO: filterProduct completed successfully {"result_count":2,"business_id":43,"search_term":"de"} 
[2026-09-12 08:47:32] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:47:43] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:47:52] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:51:20] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:51:24] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:51:58] live.INFO: === About to call saveProductNewUnitRelationships === {"product_id":345,"request_units":[{"actual_name":"pieces","unit_id":"268","short_name":"pcs","relation_unit_id":null,"relation_qty":"1","price":"100"}],"page_batch_id":"20260912_085120_9519"} 
[2026-09-12 08:51:58] live.INFO: === saveProductNewUnitRelationships START === {"product_id":345,"product_name":"sweets"} 
[2026-09-12 08:51:58] live.INFO: Units data received {"units_data":[{"actual_name":"pieces","unit_id":"268","short_name":"pcs","relation_unit_id":null,"relation_qty":"1","price":"100"}],"count":1} 
[2026-09-12 08:51:58] live.INFO: Processing unit index: 0 {"unit_data":{"actual_name":"pieces","unit_id":"268","short_name":"pcs","relation_unit_id":null,"relation_qty":"1","price":"100"}} 
[2026-09-12 08:51:58] live.INFO: Unit found by ID {"unit_id":268,"actual_name":"pieces"} 
[2026-09-12 08:51:58] live.INFO: Unit lookup result {"found":"yes","unit_id":268,"method":"by_id"} 
[2026-09-12 08:51:58] live.INFO: Updating existing unit {"unit_id":268} 
[2026-09-12 08:51:58] live.INFO: Updated unit_price {"new_price":100.0} 
[2026-09-12 08:51:58] live.INFO: Unit updated successfully  
[2026-09-12 08:51:58] live.INFO: Setting as BASE unit {"unit_id":268} 
[2026-09-12 08:51:58] live.INFO: Base unit saved {"base_unit_id":268} 
[2026-09-12 08:51:58] live.INFO: First pass complete {"created_units_count":1,"base_unit_id":268} 
[2026-09-12 08:51:58] live.INFO: === SECOND PASS: Setting relations first ===  
[2026-09-12 08:51:58] live.INFO: === SECOND PASS: Calculating cumulative multipliers ===  
[2026-09-12 08:51:58] live.INFO: === saveProductNewUnitRelationships END ===  
[2026-09-12 08:51:58] live.INFO: OpeningStockController::add - Location Data {"product_id":"345","business_id":43,"locations":{"Illuminate\\Support\\Collection":{"39":"Greenfield Supermarket Ltd (BL0001)"}},"available_locations":[39]} 
[2026-09-12 08:51:58] live.INFO: OpeningStockController::add - Serial Numbers Check {"product_id":"345","business_id":43,"has_serial_numbers":{"39":false},"total_locations_with_serial":0} 
[2026-09-12 08:52:01] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:52:40] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:52:47] live.INFO: filterProduct method called {"business_id":43,"search_term":"de","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku"],"check_qty":false,"search_type":"like"} 
[2026-09-12 08:52:47] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 08:52:47] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 08:52:47] live.DEBUG: Applying search filters {"search_term":"de","search_type":"like","search_fields":["name","sku"]} 
[2026-09-12 08:52:47] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-12 08:52:47] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-12 08:52:47] live.INFO: filterProduct completed successfully {"result_count":2,"business_id":43,"search_term":"de"} 
[2026-09-12 08:52:51] live.INFO: filterProduct method called {"business_id":43,"search_term":"swee","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku"],"check_qty":false,"search_type":"like"} 
[2026-09-12 08:52:51] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 08:52:51] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 08:52:51] live.DEBUG: Applying search filters {"search_term":"swee","search_type":"like","search_fields":["name","sku"]} 
[2026-09-12 08:52:51] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-12 08:52:51] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-12 08:52:51] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"swee"} 
[2026-09-12 08:52:51] live.INFO: Product Row Debug - RELOADED {"product_id":345,"product_name":"sweets","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":75.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"268":{"unit_id":268,"unit_name":"pieces","unit_price":100.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-12 08:52:52] live.INFO: Fetching tax rate for product ID: 345  
[2026-09-12 08:52:52] live.INFO: Product ID 345 has no tax assigned.  
[2026-09-12 08:53:09] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:53:16] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:53:19] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:53:23] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:53:53] live.INFO: === About to call saveProductNewUnitRelationships === {"product_id":346,"request_units":[{"actual_name":"pieces","unit_id":"269","short_name":"pcs","relation_unit_id":null,"relation_qty":"1","price":"200"}],"page_batch_id":"20260912_085320_1906"} 
[2026-09-12 08:53:53] live.INFO: === saveProductNewUnitRelationships START === {"product_id":346,"product_name":"dawa 1"} 
[2026-09-12 08:53:53] live.INFO: Units data received {"units_data":[{"actual_name":"pieces","unit_id":"269","short_name":"pcs","relation_unit_id":null,"relation_qty":"1","price":"200"}],"count":1} 
[2026-09-12 08:53:53] live.INFO: Processing unit index: 0 {"unit_data":{"actual_name":"pieces","unit_id":"269","short_name":"pcs","relation_unit_id":null,"relation_qty":"1","price":"200"}} 
[2026-09-12 08:53:53] live.INFO: Unit found by ID {"unit_id":269,"actual_name":"pieces"} 
[2026-09-12 08:53:53] live.INFO: Unit lookup result {"found":"yes","unit_id":269,"method":"by_id"} 
[2026-09-12 08:53:53] live.INFO: Updating existing unit {"unit_id":269} 
[2026-09-12 08:53:53] live.INFO: Updated unit_price {"new_price":200.0} 
[2026-09-12 08:53:53] live.INFO: Unit updated successfully  
[2026-09-12 08:53:53] live.INFO: Setting as BASE unit {"unit_id":269} 
[2026-09-12 08:53:53] live.INFO: Base unit saved {"base_unit_id":269} 
[2026-09-12 08:53:53] live.INFO: First pass complete {"created_units_count":1,"base_unit_id":269} 
[2026-09-12 08:53:53] live.INFO: === SECOND PASS: Setting relations first ===  
[2026-09-12 08:53:53] live.INFO: === SECOND PASS: Calculating cumulative multipliers ===  
[2026-09-12 08:53:53] live.INFO: === saveProductNewUnitRelationships END ===  
[2026-09-12 08:53:54] live.INFO: OpeningStockController::add - Location Data {"product_id":"346","business_id":43,"locations":{"Illuminate\\Support\\Collection":{"39":"Greenfield Supermarket Ltd (BL0001)"}},"available_locations":[39]} 
[2026-09-12 08:53:54] live.INFO: OpeningStockController::add - Serial Numbers Check {"product_id":"346","business_id":43,"has_serial_numbers":{"39":false},"total_locations_with_serial":0} 
[2026-09-12 08:53:56] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:53:59] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:54:16] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:56:41] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:58:54] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 08:58:58] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 09:00:36] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 09:10:37] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 09:19:16] live.INFO: === getOpeningClosingStock START === {"business_id":1,"date":"2026-09-11","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 09:19:16] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-11"} 
[2026-09-12 09:19:16] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-11')"} 
[2026-09-12 09:19:16] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-11') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and (`purchase`.`type` = ? or (`purchase`.`type` != ? and date(transaction_date) <= '2026-09-11'))","bindings":["purchase_order",1,"opening_stock","opening_stock"]} 
[2026-09-12 09:19:16] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":0,"is_opening":true,"date":"2026-09-11"} 
[2026-09-12 09:19:16] live.INFO: === getOpeningClosingStock START === {"business_id":1,"date":"2026-09-12","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 09:19:16] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-12' (includes all types except purchase_order)"} 
[2026-09-12 09:19:16] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-12') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and date(transaction_date) <= '2026-09-12'","bindings":["purchase_order",1]} 
[2026-09-12 09:19:16] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":0,"is_opening":false,"date":"2026-09-12"} 
[2026-09-12 09:20:37] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 09:30:35] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 09:40:37] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 09:50:35] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 09:50:48] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 09:54:23] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 10:04:26] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 10:14:27] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 10:24:33] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 10:34:23] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 10:44:27] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 10:54:27] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 11:04:37] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 11:14:37] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 11:24:29] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 11:34:24] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 11:44:34] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 11:46:27] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 11:46:31] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 11:46:44] live.EMERGENCY: File:/home/risetclo/r.riset.cloud/app/Http/Controllers/ImportProductsController.phpLine:608Message:Invalid value for MANAGE STOCK in row no. 1  
[2026-09-12 11:46:47] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 11:48:23] live.EMERGENCY: File:/home/risetclo/r.riset.cloud/app/Http/Controllers/ImportProductsController.phpLine:608Message:Invalid value for MANAGE STOCK in row no. 1  
[2026-09-12 11:48:26] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 11:48:39] live.EMERGENCY: File:/home/risetclo/r.riset.cloud/app/Http/Controllers/ImportProductsController.phpLine:608Message:Invalid value for MANAGE STOCK in row no. 1  
[2026-09-12 11:48:41] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 11:50:08] live.EMERGENCY: File:/home/risetclo/r.riset.cloud/app/Http/Controllers/ImportProductsController.phpLine:608Message:Invalid value for Selling Price Tax Type in row no. 1  
[2026-09-12 11:50:11] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 12:00:13] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 12:10:21] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 12:13:02] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-11","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 12:13:02] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-11"} 
[2026-09-12 12:13:02] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-11')"} 
[2026-09-12 12:13:02] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-11') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and (`purchase`.`type` = ? or (`purchase`.`type` != ? and date(transaction_date) <= '2026-09-11'))","bindings":["purchase_order",43,"opening_stock","opening_stock"]} 
[2026-09-12 12:13:02] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"8845202.43600000","is_opening":true,"date":"2026-09-11"} 
[2026-09-12 12:13:02] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-12","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 12:13:02] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-12' (includes all types except purchase_order)"} 
[2026-09-12 12:13:02] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-12') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and date(transaction_date) <= '2026-09-12'","bindings":["purchase_order",43]} 
[2026-09-12 12:13:02] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"8845167.43600000","is_opening":false,"date":"2026-09-12"} 
[2026-09-12 12:13:03] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 12:13:10] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 12:18:20] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-11","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 12:18:20] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-11"} 
[2026-09-12 12:18:20] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-11')"} 
[2026-09-12 12:18:20] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-11') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and (`purchase`.`type` = ? or (`purchase`.`type` != ? and date(transaction_date) <= '2026-09-11'))","bindings":["purchase_order",43,"opening_stock","opening_stock"]} 
[2026-09-12 12:18:20] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"8845202.43600000","is_opening":true,"date":"2026-09-11"} 
[2026-09-12 12:18:20] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-12","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 12:18:20] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-12' (includes all types except purchase_order)"} 
[2026-09-12 12:18:20] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-12') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and date(transaction_date) <= '2026-09-12'","bindings":["purchase_order",43]} 
[2026-09-12 12:18:20] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"8845167.43600000","is_opening":false,"date":"2026-09-12"} 
[2026-09-12 12:18:21] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 12:18:28] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 12:18:43] live.EMERGENCY: File:/home/risetclo/r.riset.cloud/app/Http/Controllers/ImportProductsController.phpLine:608Message:Invalid value for Selling Price Tax Type in row no. 1  
[2026-09-12 12:18:47] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 12:25:14] live.EMERGENCY: File:/home/risetclo/r.riset.cloud/app/Http/Controllers/ImportProductsController.phpLine:608Message:Some of the columns are missing. Please, use latest CSV file template.  
[2026-09-12 12:25:17] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 12:35:17] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 12:45:27] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 12:55:27] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 12:59:24] live.INFO: === getOpeningClosingStock START === {"business_id":8,"date":"2026-09-11","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 12:59:24] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-11"} 
[2026-09-12 12:59:24] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-11')"} 
[2026-09-12 12:59:24] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-11') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and (`purchase`.`type` = ? or (`purchase`.`type` != ? and date(transaction_date) <= '2026-09-11'))","bindings":["purchase_order",8,"opening_stock","opening_stock"]} 
[2026-09-12 12:59:24] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"152117426.93480000","is_opening":true,"date":"2026-09-11"} 
[2026-09-12 12:59:24] live.INFO: === getOpeningClosingStock START === {"business_id":8,"date":"2026-09-12","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 12:59:24] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-12' (includes all types except purchase_order)"} 
[2026-09-12 12:59:24] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-12') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and date(transaction_date) <= '2026-09-12'","bindings":["purchase_order",8]} 
[2026-09-12 12:59:24] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"152117426.93480000","is_opening":false,"date":"2026-09-12"} 
[2026-09-12 13:00:39] live.INFO: === About to call saveProductNewUnitRelationships === {"product_id":347,"request_units":[{"actual_name":"T1","unit_id":"277","short_name":"t1","relation_unit_id":null,"relation_qty":"1","price":"150"},{"actual_name":"T2","unit_id":"278","short_name":"t1","relation_unit_id":"277","relation_qty":"12","price":"1500"}],"page_batch_id":"20260912_125934_4887"} 
[2026-09-12 13:00:39] live.INFO: === saveProductNewUnitRelationships START === {"product_id":347,"product_name":"DefaultEdit"} 
[2026-09-12 13:00:39] live.INFO: Units data received {"units_data":[{"actual_name":"T1","unit_id":"277","short_name":"t1","relation_unit_id":null,"relation_qty":"1","price":"150"},{"actual_name":"T2","unit_id":"278","short_name":"t1","relation_unit_id":"277","relation_qty":"12","price":"1500"}],"count":2} 
[2026-09-12 13:00:39] live.INFO: Processing unit index: 0 {"unit_data":{"actual_name":"T1","unit_id":"277","short_name":"t1","relation_unit_id":null,"relation_qty":"1","price":"150"}} 
[2026-09-12 13:00:39] live.INFO: Unit found by ID {"unit_id":277,"actual_name":"T1"} 
[2026-09-12 13:00:39] live.INFO: Unit lookup result {"found":"yes","unit_id":277,"method":"by_id"} 
[2026-09-12 13:00:39] live.INFO: Updating existing unit {"unit_id":277} 
[2026-09-12 13:00:39] live.INFO: Updated unit_price {"new_price":150.0} 
[2026-09-12 13:00:39] live.INFO: Unit updated successfully  
[2026-09-12 13:00:39] live.INFO: Setting as BASE unit {"unit_id":277} 
[2026-09-12 13:00:39] live.INFO: Base unit saved {"base_unit_id":277} 
[2026-09-12 13:00:39] live.INFO: Processing unit index: 1 {"unit_data":{"actual_name":"T2","unit_id":"278","short_name":"t1","relation_unit_id":"277","relation_qty":"12","price":"1500"}} 
[2026-09-12 13:00:39] live.INFO: Unit found by ID {"unit_id":278,"actual_name":"T2"} 
[2026-09-12 13:00:39] live.INFO: Unit lookup result {"found":"yes","unit_id":278,"method":"by_id"} 
[2026-09-12 13:00:39] live.INFO: Updating existing unit {"unit_id":278} 
[2026-09-12 13:00:39] live.INFO: Updated unit_price {"new_price":1500.0} 
[2026-09-12 13:00:39] live.INFO: Unit updated successfully  
[2026-09-12 13:00:39] live.INFO: First pass complete {"created_units_count":2,"base_unit_id":277} 
[2026-09-12 13:00:39] live.INFO: === SECOND PASS: Setting relations first ===  
[2026-09-12 13:00:39] live.INFO: Setting relation for unit {"unit_id":278,"unit_name":"T2","relation_unit_id":277,"relation_unit_name":"T1","relation_qty":12.0} 
[2026-09-12 13:00:39] live.INFO: Relation saved to database {"unit_id":278,"rel_unit_id":277,"rel_unit_qty":12.0,"base_unit_id":277} 
[2026-09-12 13:00:39] live.INFO: === SECOND PASS: Calculating cumulative multipliers ===  
[2026-09-12 13:00:39] live.INFO: Calculating cumulative multiplier for unit {"unit_id":278,"unit_name":"T2"} 
[2026-09-12 13:00:39] live.INFO: === calculateCumulativeMultiplier START === {"unit_id":278,"business_id":8} 
[2026-09-12 13:00:39] live.INFO: Unit found {"unit_id":278,"unit_name":"T2","rel_unit_id":277,"rel_unit_qty":"12.0000","base_unit_id":277} 
[2026-09-12 13:00:39] live.INFO: Starting cumulative multiplier {"initial_multiplier":12.0} 
[2026-09-12 13:00:39] live.INFO: Traversing up chain depth: 0 {"current_unit_id":277} 
[2026-09-12 13:00:39] live.INFO: Parent unit found {"parent_unit_id":277,"parent_unit_name":"T1","parent_rel_unit_id":null,"parent_rel_unit_qty":"1.0000"} 
[2026-09-12 13:00:39] live.INFO: Reached base unit (no rel_unit_id), stopping  
[2026-09-12 13:00:39] live.INFO: Chain traversal complete {"chain":"T2 (278) -> T1 (277)","final_cumulative_multiplier":12.0,"depth_traversed":0} 
[2026-09-12 13:00:39] live.INFO: === calculateCumulativeMultiplier END === {"result":12.0} 
[2026-09-12 13:00:39] live.INFO: Cumulative multiplier calculated {"unit_id":278,"unit_name":"T2","cumulative_multiplier":12.0} 
[2026-09-12 13:00:39] live.INFO: Unit saved with cumulative multiplier {"unit_id":278,"unit_name":"T2","base_unit_multiplier":12.0} 
[2026-09-12 13:00:39] live.INFO: === saveProductNewUnitRelationships END ===  
[2026-09-12 13:00:39] live.INFO: OpeningStockController::add - Location Data {"product_id":"347","business_id":8,"locations":{"Illuminate\\Support\\Collection":{"9":"BQT GENERAL BUSINESS (BL0001)","10":"BQT BRANCH 1 (BL0002)","12":"BQT BRANCH 2 (BL0003)","14":"BQT BRANCH 3 (BL0004)"}},"available_locations":[9]} 
[2026-09-12 13:00:39] live.INFO: OpeningStockController::add - Serial Numbers Check {"product_id":"347","business_id":8,"has_serial_numbers":{"9":false},"total_locations_with_serial":0} 
[2026-09-12 13:00:55] live.INFO: filterProduct method called {"business_id":8,"search_term":"defa","location_id":"9","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku","lot"],"check_qty":false,"search_type":"like"} 
[2026-09-12 13:00:55] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 13:00:55] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 13:00:55] live.DEBUG: Joining purchase_lines for lot number search  
[2026-09-12 13:00:55] live.DEBUG: Applying search filters {"search_term":"defa","search_type":"like","search_fields":["name","sku","lot"]} 
[2026-09-12 13:00:55] live.DEBUG: LIKE search conditions applied {"fields":["name","sku","lot"]} 
[2026-09-12 13:00:55] live.DEBUG: Applying location filter {"location_id":"9"} 
[2026-09-12 13:00:55] live.DEBUG: Added lot number fields to select  
[2026-09-12 13:00:55] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":8,"search_term":"defa"} 
[2026-09-12 13:00:56] live.INFO: Product Row Debug - RELOADED {"product_id":347,"product_name":"DefaultEdit","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":150.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"277":{"unit_id":277,"unit_name":"T1","unit_price":150.0,"multiplier":1,"has_price":true},"278":{"unit_id":278,"unit_name":"T2","unit_price":1500.0,"multiplier":"12.0000","has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-12 13:01:00] live.ERROR: Failed to send error alert email: Failed to authenticate on SMTP server with username "support@risetsystems.com" using the following authenticators: "LOGIN", "PLAIN". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".".  
[2026-09-12 13:01:00] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:00] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:00] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:00] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:01] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:01] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:01] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:01] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:07] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:07] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:08] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:08] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:08] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:08] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:09] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:09] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:14] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:14] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:14] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:14] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:15] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:15] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:15] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:15] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:18] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:18] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:18] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:18] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:19] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:19] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:19] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:19] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:23] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:23] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:32] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:32] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:32] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:32] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:33] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:33] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:33] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:33] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:39] live.INFO: filterProduct method called {"business_id":8,"search_term":"test","location_id":"9","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku","lot"],"check_qty":false,"search_type":"like"} 
[2026-09-12 13:01:39] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 13:01:39] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 13:01:39] live.DEBUG: Joining purchase_lines for lot number search  
[2026-09-12 13:01:39] live.DEBUG: Applying search filters {"search_term":"test","search_type":"like","search_fields":["name","sku","lot"]} 
[2026-09-12 13:01:39] live.DEBUG: LIKE search conditions applied {"fields":["name","sku","lot"]} 
[2026-09-12 13:01:39] live.DEBUG: Applying location filter {"location_id":"9"} 
[2026-09-12 13:01:39] live.DEBUG: Added lot number fields to select  
[2026-09-12 13:01:39] live.INFO: filterProduct completed successfully {"result_count":3,"business_id":8,"search_term":"test"} 
[2026-09-12 13:01:45] live.ERROR: Failed to send error alert email: Failed to authenticate on SMTP server with username "support@risetsystems.com" using the following authenticators: "LOGIN", "PLAIN". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".".  
[2026-09-12 13:01:45] live.INFO: filterProduct method called {"business_id":8,"search_term":"defaul","location_id":"9","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku","lot","serial_number"],"check_qty":false,"search_type":"like"} 
[2026-09-12 13:01:45] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 13:01:45] live.DEBUG: Joining product_serial_numbers table for serial number search  
[2026-09-12 13:01:45] live.DEBUG: Serial numbers filtered by location {"location_id":"9"} 
[2026-09-12 13:01:45] live.DEBUG: Joining transaction_sell_lines and transactions to check if serial number is sold  
[2026-09-12 13:01:45] live.DEBUG: Added condition: keep products without serial numbers OR with available quantity > 0  
[2026-09-12 13:01:45] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 13:01:45] live.DEBUG: Joining purchase_lines for lot number search  
[2026-09-12 13:01:45] live.DEBUG: Applying search filters {"search_term":"defaul","search_type":"like","search_fields":["name","sku","lot","serial_number"]} 
[2026-09-12 13:01:45] live.DEBUG: LIKE search conditions applied {"fields":["name","sku","lot","serial_number"]} 
[2026-09-12 13:01:45] live.DEBUG: Applying location filter {"location_id":"9"} 
[2026-09-12 13:01:45] live.DEBUG: Added serial number, quantity, and transaction sell line fields with quantity details to select  
[2026-09-12 13:01:45] live.DEBUG: Added lot number fields to select  
[2026-09-12 13:01:46] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":8,"search_term":"defaul"} 
[2026-09-12 13:01:46] live.INFO: Product Row Debug - RELOADED {"product_id":347,"product_name":"DefaultEdit","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":150.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"277":{"unit_id":277,"unit_name":"T1","unit_price":150.0,"multiplier":1,"has_price":true},"278":{"unit_id":278,"unit_name":"T2","unit_price":1500.0,"multiplier":"12.0000","has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-12 13:01:48] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:48] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:49] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:49] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:49] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:49] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:01:50] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:01:50] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:05:27] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:10:35] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-11","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 13:10:35] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-11"} 
[2026-09-12 13:10:35] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-11')"} 
[2026-09-12 13:10:35] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-11') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and (`purchase`.`type` = ? or (`purchase`.`type` != ? and date(transaction_date) <= '2026-09-11'))","bindings":["purchase_order",43,"opening_stock","opening_stock"]} 
[2026-09-12 13:10:35] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"8845202.43600000","is_opening":true,"date":"2026-09-11"} 
[2026-09-12 13:10:35] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-12","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 13:10:35] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-12' (includes all types except purchase_order)"} 
[2026-09-12 13:10:35] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-12') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and date(transaction_date) <= '2026-09-12'","bindings":["purchase_order",43]} 
[2026-09-12 13:10:35] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"8845167.43600000","is_opening":false,"date":"2026-09-12"} 
[2026-09-12 13:10:37] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:10:40] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-11","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 13:10:40] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-11"} 
[2026-09-12 13:10:40] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-11')"} 
[2026-09-12 13:10:40] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-11') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and (`purchase`.`type` = ? or (`purchase`.`type` != ? and date(transaction_date) <= '2026-09-11'))","bindings":["purchase_order",43,"opening_stock","opening_stock"]} 
[2026-09-12 13:10:40] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"8845202.43600000","is_opening":true,"date":"2026-09-11"} 
[2026-09-12 13:10:40] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-12","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 13:10:40] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-12' (includes all types except purchase_order)"} 
[2026-09-12 13:10:40] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-12') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and date(transaction_date) <= '2026-09-12'","bindings":["purchase_order",43]} 
[2026-09-12 13:10:40] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"8845167.43600000","is_opening":false,"date":"2026-09-12"} 
[2026-09-12 13:10:42] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:10:59] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:15:13] live.INFO: filterProduct method called {"business_id":8,"search_term":"def","location_id":"9","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku","lot"],"check_qty":false,"search_type":"like"} 
[2026-09-12 13:15:13] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 13:15:13] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 13:15:13] live.DEBUG: Joining purchase_lines for lot number search  
[2026-09-12 13:15:13] live.DEBUG: Applying search filters {"search_term":"def","search_type":"like","search_fields":["name","sku","lot"]} 
[2026-09-12 13:15:13] live.DEBUG: LIKE search conditions applied {"fields":["name","sku","lot"]} 
[2026-09-12 13:15:13] live.DEBUG: Applying location filter {"location_id":"9"} 
[2026-09-12 13:15:13] live.DEBUG: Added lot number fields to select  
[2026-09-12 13:15:13] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":8,"search_term":"def"} 
[2026-09-12 13:15:14] live.INFO: Product Row Debug - RELOADED {"product_id":347,"product_name":"DefaultEdit","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":150.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"277":{"unit_id":277,"unit_name":"T1","unit_price":150.0,"multiplier":1,"has_price":true},"278":{"unit_id":278,"unit_name":"T2","unit_price":1500.0,"multiplier":"12.0000","has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-12 13:15:16] live.ERROR: Failed to send error alert email: Failed to authenticate on SMTP server with username "support@risetsystems.com" using the following authenticators: "LOGIN", "PLAIN". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".".  
[2026-09-12 13:15:19] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:15:19] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:15:20] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:15:20] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:15:20] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:15:20] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:15:20] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:15:20] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:15:21] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:15:21] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:16:16] live.INFO: === saveProductUnitRelationships START === {"product_id":347,"product_name":"DefaultEdit"} 
[2026-09-12 13:16:16] live.INFO: Units data received {"units_data":[{"actual_name":"277","unit_id":"277","short_name":"t1","allow_decimal":"1","relation_unit_id":null,"relation_qty":"1","price":"150.0000"},{"actual_name":"278","unit_id":"278","short_name":"t1","allow_decimal":"1","relation_unit_id":"277","relation_qty":"12.0000","price":"1350"}],"count":2} 
[2026-09-12 13:16:16] live.INFO: Processing unit index: 0 {"unit_data":{"actual_name":"277","unit_id":"277","short_name":"t1","allow_decimal":"1","relation_unit_id":null,"relation_qty":"1","price":"150.0000"}} 
[2026-09-12 13:16:16] live.INFO: Unit found by ID {"unit_id":277,"actual_name":"T1"} 
[2026-09-12 13:16:16] live.WARNING: Skipping actual_name update - value looks like an ID {"actual_name":"277","unit_id":277} 
[2026-09-12 13:16:16] live.INFO: Setting as BASE unit {"unit_id":277} 
[2026-09-12 13:16:16] live.INFO: Unit saved {"unit_id":277,"unit_name":"T1","is_base":true} 
[2026-09-12 13:16:16] live.INFO: Processing unit index: 1 {"unit_data":{"actual_name":"278","unit_id":"278","short_name":"t1","allow_decimal":"1","relation_unit_id":"277","relation_qty":"12.0000","price":"1350"}} 
[2026-09-12 13:16:16] live.INFO: Unit found by ID {"unit_id":278,"actual_name":"T2"} 
[2026-09-12 13:16:16] live.INFO: Updated unit_price {"new_price":1350.0} 
[2026-09-12 13:16:16] live.WARNING: Skipping actual_name update - value looks like an ID {"actual_name":"278","unit_id":278} 
[2026-09-12 13:16:16] live.INFO: Unit saved {"unit_id":278,"unit_name":"T2","is_base":false} 
[2026-09-12 13:16:16] live.INFO: First pass complete {"created_units_count":2,"unit_ids_to_keep":[277,278],"base_unit_id":277} 
[2026-09-12 13:16:16] live.INFO: === SECOND PASS: Setting relations first ===  
[2026-09-12 13:16:16] live.INFO: Setting relation for unit {"unit_id":278,"unit_name":"T2","relation_unit_id":277,"relation_unit_name":"T1","relation_qty":12.0} 
[2026-09-12 13:16:16] live.INFO: Relation saved to database {"unit_id":278,"rel_unit_id":277,"rel_unit_qty":12.0,"base_unit_id":277} 
[2026-09-12 13:16:16] live.INFO: === SECOND PASS: Calculating cumulative multipliers ===  
[2026-09-12 13:16:16] live.INFO: Calculating cumulative multiplier for unit {"unit_id":278,"unit_name":"T2"} 
[2026-09-12 13:16:16] live.INFO: === calculateCumulativeMultiplier START === {"unit_id":278,"business_id":8} 
[2026-09-12 13:16:16] live.INFO: Unit found {"unit_id":278,"unit_name":"T2","rel_unit_id":277,"rel_unit_qty":"12.0000","base_unit_id":277} 
[2026-09-12 13:16:16] live.INFO: Starting cumulative multiplier {"initial_multiplier":12.0} 
[2026-09-12 13:16:16] live.INFO: Traversing up chain depth: 0 {"current_unit_id":277} 
[2026-09-12 13:16:16] live.INFO: Parent unit found {"parent_unit_id":277,"parent_unit_name":"T1","parent_rel_unit_id":null,"parent_rel_unit_qty":"1.0000"} 
[2026-09-12 13:16:16] live.INFO: Reached base unit (no rel_unit_id), stopping  
[2026-09-12 13:16:16] live.INFO: Chain traversal complete {"chain":"T2 (278) -> T1 (277)","final_cumulative_multiplier":12.0,"depth_traversed":0} 
[2026-09-12 13:16:16] live.INFO: === calculateCumulativeMultiplier END === {"result":12.0} 
[2026-09-12 13:16:16] live.INFO: Cumulative multiplier calculated {"unit_id":278,"unit_name":"T2","cumulative_multiplier":12.0} 
[2026-09-12 13:16:16] live.INFO: Unit saved with cumulative multiplier {"unit_id":278,"unit_name":"T2","base_unit_multiplier":12.0} 
[2026-09-12 13:16:16] live.INFO: === Cleaning up unused units === {"unit_ids_to_keep":[277,278],"base_unit_id":277,"page_batch_id":"20260912_125934_4887"} 
[2026-09-12 13:16:16] live.INFO: Units to delete {"count":0,"unit_ids":[]} 
[2026-09-12 13:16:16] live.INFO: === saveProductUnitRelationships END ===  
[2026-09-12 13:16:38] live.INFO: filterProduct method called {"business_id":8,"search_term":"defau","location_id":"9","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku","lot","serial_number"],"check_qty":false,"search_type":"like"} 
[2026-09-12 13:16:38] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-12 13:16:38] live.DEBUG: Joining product_serial_numbers table for serial number search  
[2026-09-12 13:16:38] live.DEBUG: Serial numbers filtered by location {"location_id":"9"} 
[2026-09-12 13:16:38] live.DEBUG: Joining transaction_sell_lines and transactions to check if serial number is sold  
[2026-09-12 13:16:38] live.DEBUG: Added condition: keep products without serial numbers OR with available quantity > 0  
[2026-09-12 13:16:38] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-12 13:16:38] live.DEBUG: Joining purchase_lines for lot number search  
[2026-09-12 13:16:38] live.DEBUG: Applying search filters {"search_term":"defau","search_type":"like","search_fields":["name","sku","lot","serial_number"]} 
[2026-09-12 13:16:38] live.DEBUG: LIKE search conditions applied {"fields":["name","sku","lot","serial_number"]} 
[2026-09-12 13:16:38] live.DEBUG: Applying location filter {"location_id":"9"} 
[2026-09-12 13:16:38] live.DEBUG: Added serial number, quantity, and transaction sell line fields with quantity details to select  
[2026-09-12 13:16:38] live.DEBUG: Added lot number fields to select  
[2026-09-12 13:16:38] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":8,"search_term":"defau"} 
[2026-09-12 13:16:39] live.INFO: Product Row Debug - RELOADED {"product_id":347,"product_name":"DefaultEdit","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":150.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"277":{"unit_id":277,"unit_name":"T1","unit_price":150.0,"multiplier":1,"has_price":true},"278":{"unit_id":278,"unit_name":"T2","unit_price":1350.0,"multiplier":"12.0000","has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-12 13:16:43] live.ERROR: Failed to send error alert email: Failed to authenticate on SMTP server with username "support@risetsystems.com" using the following authenticators: "LOGIN", "PLAIN". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".".  
[2026-09-12 13:16:47] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:16:47] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:16:48] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:16:48] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:16:48] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:16:48] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:16:49] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:16:49] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:16:49] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:16:49] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:16:52] live.INFO: Fetching tax rate for product ID: 347  
[2026-09-12 13:16:52] live.INFO: Product ID 347 has no tax assigned.  
[2026-09-12 13:16:59] live.INFO: Credit Limit Check Started {"contact_id":"94","status":"final","final_total":"2700.00","is_credit_sale":"0","exclude_transaction_id":null} 
[2026-09-12 13:16:59] live.DEBUG: Payment Calculation {"final_total":2700.0,"curr_total_payment":3600.0,"is_credit_sale":false,"payment_count":1} 
[2026-09-12 13:16:59] live.INFO: Credit Limit Check Skipped - Fully Paid {"final_total":2700.0,"curr_total_payment":3600.0} 
[2026-09-12 13:16:59] live.INFO: mpesa_transaction_id value: NULL  
[2026-09-12 13:16:59] live.INFO: is_mpesa_sale value: true  
[2026-09-12 13:16:59] live.INFO: M-Pesa sale evaluation {"is_mpesa_sale_raw":true,"is_valid_mpesa_sale":false,"payment_method_input":"cash","mpesa_transaction_id":null,"transaction_id":1843} 
[2026-09-12 13:16:59] live.INFO: Journal Entry Case: FULL CASH PAYMENT {"transaction_id":1843,"final_total":2700.0,"amount_paid":3600.0,"balance_due":0} 
[2026-09-12 13:16:59] live.INFO: Journal Entries Inserted Successfully {"transaction_id":1843,"entries":[{"transaction_id":1843,"created_by_id":229,"transaction_number":"TRX-6aa5269b66d6c5.49809177","payment_detail_id":1319,"location_id":"9","currency_id":133,"transaction_type":"sell","date":"2026-09-12","month":9,"year":2026,"active":1,"reversed":0,"reversible":1,"manual_entry":1,"created_at":"2026-09-12 13:16:59","updated_at":"2026-09-12 13:16:59","chart_of_account_id":23,"debit":null,"credit":2700.0},{"transaction_id":1843,"created_by_id":229,"transaction_number":"TRX-6aa5269b66d6c5.49809177","payment_detail_id":1319,"location_id":"9","currency_id":133,"transaction_type":"sell","date":"2026-09-12","month":9,"year":2026,"active":1,"reversed":0,"reversible":1,"manual_entry":1,"created_at":"2026-09-12 13:16:59","updated_at":"2026-09-12 13:16:59","chart_of_account_id":27,"debit":2700.0,"credit":null}]} 
[2026-09-12 13:16:59] live.INFO: Inserted purchase sell mapping {"count":1,"data":[{"sell_line_id":1178,"purchase_line_id":1584,"quantity":24.0,"created_at":"2026-09-12 13:16:59","updated_at":"2026-09-12 13:16:59"}]} 
[2026-09-12 13:16:59] live.INFO: Inserted COGS → Inventory journal entries {"count":2} 
[2026-09-12 13:16:59] live.INFO: Inserted Retained Earnings (profit) entries {"count":1,"total_profit":588.0} 
[2026-09-12 13:16:59] live.INFO: ETIMS: Customer details retrieved {"transaction_id":1843,"contact_id":94,"customer_name":"Walk-In Customer","has_tin":false,"has_digitax_id":false} 
[2026-09-12 13:16:59] live.ERROR: ETIMS: Missing item_id for product {"product_id":347} 
[2026-09-12 13:16:59] live.ERROR: ETIMS: No valid items to submit after filtering  
[2026-09-12 13:16:59] live.WARNING: ETIMS WAIT: Timed out after 2 attempts for transaction ID: 1843  
[2026-09-12 13:17:34] live.INFO: === saveProductUnitRelationships START === {"product_id":347,"product_name":"DefaultEdit"} 
[2026-09-12 13:17:34] live.INFO: Units data received {"units_data":[{"actual_name":"277","unit_id":"277","short_name":"t1","allow_decimal":"1","relation_unit_id":null,"relation_qty":"1","price":"150.0000"},{"actual_name":"278","unit_id":"278","short_name":"t2","allow_decimal":"1","relation_unit_id":"277","relation_qty":"12.0000","price":"1350.0000"}],"count":2} 
[2026-09-12 13:17:34] live.INFO: Processing unit index: 0 {"unit_data":{"actual_name":"277","unit_id":"277","short_name":"t1","allow_decimal":"1","relation_unit_id":null,"relation_qty":"1","price":"150.0000"}} 
[2026-09-12 13:17:34] live.INFO: Unit found by ID {"unit_id":277,"actual_name":"T1"} 
[2026-09-12 13:17:34] live.WARNING: Skipping actual_name update - value looks like an ID {"actual_name":"277","unit_id":277} 
[2026-09-12 13:17:34] live.INFO: Setting as BASE unit {"unit_id":277} 
[2026-09-12 13:17:34] live.INFO: Unit saved {"unit_id":277,"unit_name":"T1","is_base":true} 
[2026-09-12 13:17:34] live.INFO: Processing unit index: 1 {"unit_data":{"actual_name":"278","unit_id":"278","short_name":"t2","allow_decimal":"1","relation_unit_id":"277","relation_qty":"12.0000","price":"1350.0000"}} 
[2026-09-12 13:17:34] live.INFO: Unit found by ID {"unit_id":278,"actual_name":"T2"} 
[2026-09-12 13:17:34] live.INFO: Updated short_name {"new_short_name":"t2"} 
[2026-09-12 13:17:34] live.WARNING: Skipping actual_name update - value looks like an ID {"actual_name":"278","unit_id":278} 
[2026-09-12 13:17:34] live.INFO: Unit saved {"unit_id":278,"unit_name":"T2","is_base":false} 
[2026-09-12 13:17:34] live.INFO: First pass complete {"created_units_count":2,"unit_ids_to_keep":[277,278],"base_unit_id":277} 
[2026-09-12 13:17:34] live.INFO: === SECOND PASS: Setting relations first ===  
[2026-09-12 13:17:34] live.INFO: Setting relation for unit {"unit_id":278,"unit_name":"T2","relation_unit_id":277,"relation_unit_name":"T1","relation_qty":12.0} 
[2026-09-12 13:17:34] live.INFO: Relation saved to database {"unit_id":278,"rel_unit_id":277,"rel_unit_qty":12.0,"base_unit_id":277} 
[2026-09-12 13:17:34] live.INFO: === SECOND PASS: Calculating cumulative multipliers ===  
[2026-09-12 13:17:34] live.INFO: Calculating cumulative multiplier for unit {"unit_id":278,"unit_name":"T2"} 
[2026-09-12 13:17:34] live.INFO: === calculateCumulativeMultiplier START === {"unit_id":278,"business_id":8} 
[2026-09-12 13:17:34] live.INFO: Unit found {"unit_id":278,"unit_name":"T2","rel_unit_id":277,"rel_unit_qty":"12.0000","base_unit_id":277} 
[2026-09-12 13:17:34] live.INFO: Starting cumulative multiplier {"initial_multiplier":12.0} 
[2026-09-12 13:17:34] live.INFO: Traversing up chain depth: 0 {"current_unit_id":277} 
[2026-09-12 13:17:34] live.INFO: Parent unit found {"parent_unit_id":277,"parent_unit_name":"T1","parent_rel_unit_id":null,"parent_rel_unit_qty":"1.0000"} 
[2026-09-12 13:17:34] live.INFO: Reached base unit (no rel_unit_id), stopping  
[2026-09-12 13:17:34] live.INFO: Chain traversal complete {"chain":"T2 (278) -> T1 (277)","final_cumulative_multiplier":12.0,"depth_traversed":0} 
[2026-09-12 13:17:34] live.INFO: === calculateCumulativeMultiplier END === {"result":12.0} 
[2026-09-12 13:17:34] live.INFO: Cumulative multiplier calculated {"unit_id":278,"unit_name":"T2","cumulative_multiplier":12.0} 
[2026-09-12 13:17:34] live.INFO: Unit saved with cumulative multiplier {"unit_id":278,"unit_name":"T2","base_unit_multiplier":12.0} 
[2026-09-12 13:17:34] live.INFO: === Cleaning up unused units === {"unit_ids_to_keep":[277,278],"base_unit_id":277,"page_batch_id":"20260912_125934_4887"} 
[2026-09-12 13:17:34] live.INFO: Units to delete {"count":0,"unit_ids":[]} 
[2026-09-12 13:17:34] live.INFO: === saveProductUnitRelationships END ===  
[2026-09-12 13:17:52] live.WARNING: ETIMS WAIT: Timed out after 2 attempts for transaction ID: 1843  
[2026-09-12 13:18:07] live.INFO: Credit Limit Check Started {"contact_id":"94","status":"final","final_total":"4050.00","is_credit_sale":"0","exclude_transaction_id":"1843"} 
[2026-09-12 13:18:07] live.DEBUG: Payment Calculation {"final_total":4050.0,"curr_total_payment":4050.0,"is_credit_sale":false,"payment_count":1} 
[2026-09-12 13:18:07] live.INFO: Credit Limit Check Skipped - Fully Paid {"final_total":4050.0,"curr_total_payment":4050.0} 
[2026-09-12 13:18:07] live.INFO: Inserted purchase sell mapping {"count":1,"data":[{"sell_line_id":1178,"purchase_line_id":1584,"quantity":12.0,"created_at":"2026-09-12 13:18:07","updated_at":"2026-09-12 13:18:07"}]} 
[2026-09-12 13:18:07] live.INFO: Inserted COGS → Inventory journal entries {"count":2} 
[2026-09-12 13:18:07] live.INFO: Inserted Retained Earnings (profit) entries {"count":1,"total_profit":882.0} 
[2026-09-12 13:18:07] live.INFO: ETIMS: Customer details retrieved {"transaction_id":1843,"contact_id":94,"customer_name":"Walk-In Customer","has_tin":false,"has_digitax_id":false} 
[2026-09-12 13:18:07] live.ERROR: ETIMS: Missing item_id for product {"product_id":347} 
[2026-09-12 13:18:07] live.ERROR: ETIMS: No valid items to submit after filtering  
[2026-09-12 13:18:07] live.WARNING: ETIMS WAIT: Timed out after 2 attempts for transaction ID: 1843  
[2026-09-12 13:18:11] live.ERROR: Failed to send error alert email: Failed to authenticate on SMTP server with username "support@risetsystems.com" using the following authenticators: "LOGIN", "PLAIN". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".".  
[2026-09-12 13:19:13] live.ERROR: Failed to send error alert email: Failed to authenticate on SMTP server with username "support@risetsystems.com" using the following authenticators: "LOGIN", "PLAIN". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".".  
[2026-09-12 13:20:58] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:23:42] live.EMERGENCY: File:/home/risetclo/r.riset.cloud/app/Http/Controllers/ImportOpeningStockController.phpLine:189Message:Product with sku KENYLON STRAWBERRY JAM 500G not found in row no. 1  
[2026-09-12 13:23:45] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:24:20] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:24:27] live.EMERGENCY: File:/home/risetclo/r.riset.cloud/app/Http/Controllers/ImportProductsController.phpLine:608Message:No location with name 'SHOPLIX' found in row no. 1  
[2026-09-12 13:24:31] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:25:46] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:26:00] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:26:07] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:34:21] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:34:35] live.ERROR: Failed to send error alert email: Failed to authenticate on SMTP server with username "support@risetsystems.com" using the following authenticators: "LOGIN", "PLAIN". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".".  
[2026-09-12 13:34:35] live.ERROR: Unsupported operand types: string * int {"userId":293,"exception":"[object] (TypeError(code: 0): Unsupported operand types: string * int at /home/risetclo/r.riset.cloud/app/Utils/Util.php:108)
[stacktrace]
#0 /home/risetclo/r.riset.cloud/app/Http/Controllers/ImportProductsController.php(723): App\\Utils\\Util->calc_percentage_base('=U2/2', 16.0)
#1 /home/risetclo/r.riset.cloud/app/Http/Controllers/ImportProductsController.php(386): App\\Http\\Controllers\\ImportProductsController->calculateVariationPrices(0, '=U2/2', '200', 16.0, 'inclusive', 25.0)
#2 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\ImportProductsController->store(Object(Illuminate\\Http\\Request))
#3 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction('store', Array)
#4 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Route.php(259): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\ImportProductsController), 'store')
#5 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#6 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\\Routing\\Route->run()
#7 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#8 /home/risetclo/r.riset.cloud/app/Http/Middleware/CheckStockTake.php(47): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#9 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\CheckStockTake->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#10 /home/risetclo/r.riset.cloud/app/Http/Middleware/CheckUserLogin.php(22): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#11 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\CheckUserLogin->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#12 /home/risetclo/r.riset.cloud/app/Http/Middleware/AdminSidebarMenu.php(1281): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#13 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\AdminSidebarMenu->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#14 /home/risetclo/r.riset.cloud/app/Http/Middleware/Timezone.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#15 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\Timezone->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#16 /home/risetclo/r.riset.cloud/app/Http/Middleware/Language.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#17 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\Language->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#18 /home/risetclo/r.riset.cloud/app/Http/Middleware/SetSessionData.php(52): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#19 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\SetSessionData->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#20 /home/risetclo/r.riset.cloud/app/Http/Middleware/IsInstalled.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#21 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\IsInstalled->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#22 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#23 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#24 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#25 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Auth\\Middleware\\Authenticate->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#26 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#27 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#28 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#29 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#30 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#31 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest(Object(Illuminate\\Http\\Request), Object(Illuminate\\Session\\Store), Object(Closure))
#32 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#33 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#34 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#35 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#36 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#37 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#38 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(797): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#39 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(776): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#40 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(740): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#41 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(729): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#42 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(190): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#43 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#44 /home/risetclo/r.riset.cloud/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#45 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#46 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#47 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#48 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#49 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#50 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#51 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#52 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#53 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#54 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#55 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#56 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#57 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#58 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#59 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#60 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#61 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#62 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#63 /home/risetclo/r.riset.cloud/public/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#64 {main}
"} 
[2026-09-12 13:34:56] live.ERROR: Failed to send error alert email: Failed to authenticate on SMTP server with username "support@risetsystems.com" using the following authenticators: "LOGIN", "PLAIN". Authenticator "LOGIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".". Authenticator "PLAIN" returned "Expected response code "235" but got code "535", with message "535 Incorrect authentication data".".  
[2026-09-12 13:34:56] live.ERROR: Unsupported operand types: string * int {"userId":293,"exception":"[object] (TypeError(code: 0): Unsupported operand types: string * int at /home/risetclo/r.riset.cloud/app/Utils/Util.php:108)
[stacktrace]
#0 /home/risetclo/r.riset.cloud/app/Http/Controllers/ImportProductsController.php(723): App\\Utils\\Util->calc_percentage_base('=U2/2', 16.0)
#1 /home/risetclo/r.riset.cloud/app/Http/Controllers/ImportProductsController.php(386): App\\Http\\Controllers\\ImportProductsController->calculateVariationPrices(0, '=U2/2', '200', 16.0, 'inclusive', 25.0)
#2 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\ImportProductsController->store(Object(Illuminate\\Http\\Request))
#3 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction('store', Array)
#4 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Route.php(259): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\ImportProductsController), 'store')
#5 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#6 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\\Routing\\Route->run()
#7 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))
#8 /home/risetclo/r.riset.cloud/app/Http/Middleware/CheckStockTake.php(47): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#9 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\CheckStockTake->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#10 /home/risetclo/r.riset.cloud/app/Http/Middleware/CheckUserLogin.php(22): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#11 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\CheckUserLogin->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#12 /home/risetclo/r.riset.cloud/app/Http/Middleware/AdminSidebarMenu.php(1281): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#13 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\AdminSidebarMenu->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#14 /home/risetclo/r.riset.cloud/app/Http/Middleware/Timezone.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#15 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\Timezone->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#16 /home/risetclo/r.riset.cloud/app/Http/Middleware/Language.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#17 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\Language->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#18 /home/risetclo/r.riset.cloud/app/Http/Middleware/SetSessionData.php(52): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#19 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\SetSessionData->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#20 /home/risetclo/r.riset.cloud/app/Http/Middleware/IsInstalled.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#21 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\IsInstalled->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#22 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#23 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#24 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#25 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Auth\\Middleware\\Authenticate->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#26 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#27 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#28 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#29 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#30 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#31 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest(Object(Illuminate\\Http\\Request), Object(Illuminate\\Session\\Store), Object(Closure))
#32 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#33 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#34 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#35 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#36 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#37 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#38 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(797): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#39 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(776): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))
#40 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(740): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))
#41 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Routing/Router.php(729): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))
#42 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(190): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))
#43 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))
#44 /home/risetclo/r.riset.cloud/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#45 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Barryvdh\\Debugbar\\Middleware\\InjectDebugbar->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#46 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#47 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#48 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#49 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#50 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#51 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#52 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#53 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#54 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#55 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#56 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#57 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\HandleCors->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#58 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#59 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle(Object(Illuminate\\Http\\Request), Object(Closure))
#60 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))
#61 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))
#62 /home/risetclo/r.riset.cloud/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
#63 /home/risetclo/r.riset.cloud/public/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))
#64 {main}
"} 
[2026-09-12 13:36:57] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-11","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 13:36:57] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-11"} 
[2026-09-12 13:36:57] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-11')"} 
[2026-09-12 13:36:57] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-11') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and (`purchase`.`type` = ? or (`purchase`.`type` != ? and date(transaction_date) <= '2026-09-11'))","bindings":["purchase_order",43,"opening_stock","opening_stock"]} 
[2026-09-12 13:36:57] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"9010527.61600000","is_opening":true,"date":"2026-09-11"} 
[2026-09-12 13:36:57] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-12","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-12 13:36:57] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-12' (includes all types except purchase_order)"} 
[2026-09-12 13:36:57] live.DEBUG: Final SQL Query {"sql":"select SUM((purchase_lines.quantity - purchase_lines.quantity_returned - purchase_lines.quantity_adjusted -
                        (SELECT COALESCE(SUM(tspl.quantity - tspl.qty_returned), 0) FROM 
                        transaction_sell_lines_purchase_lines AS tspl
                        JOIN transaction_sell_lines as tsl ON 
                        tspl.sell_line_id=tsl.id 
                        JOIN transactions as sale ON 
                        tsl.transaction_id=sale.id 
                        WHERE tspl.purchase_line_id = purchase_lines.id AND 
                        date(sale.transaction_date) <= '2026-09-12') ) * (purchase_lines.purchase_price + 
                        COALESCE(purchase_lines.item_tax, 0))
                    ) as stock from `purchase_lines` inner join `transactions` as `purchase` on `purchase_lines`.`transaction_id` = `purchase`.`id` left join `variations` as `v` on `v`.`id` = `purchase_lines`.`variation_id` left join `products` as `p` on `p`.`id` = `purchase_lines`.`product_id` where `purchase`.`type` != ? and `purchase`.`business_id` = ? and date(transaction_date) <= '2026-09-12'","bindings":["purchase_order",43]} 
[2026-09-12 13:36:57] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"9010492.61600000","is_opening":false,"date":"2026-09-12"} 
[2026-09-12 13:36:58] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:37:03] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:37:14] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:37:20] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 13:47:19] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 16:50:29] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 16:51:00] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 16:52:13] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 16:52:21] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 17:01:06] live.INFO: Purchases array from request {"purchases":{"1":{"product_id":"165","variation_id":"166","quantity":"200","product_unit_id":"39","sub_unit_id":"39","pp_without_discount":"750","discount_percent":"0.00","purchase_price":"750.00","purchase_line_tax_id":null,"item_tax":"0.00","purchase_price_inc_tax":"750.00","profit_percent":"33.33","default_sell_price":"1,000.00","mfg_date":null,"exp_date":null,"imei_numbers":"[]","imei_count":"0"}},"purchases_json":"{\"1\":{\"product_id\":\"165\",\"variation_id\":\"166\",\"quantity\":\"200\",\"product_unit_id\":\"39\",\"sub_unit_id\":\"39\",\"pp_without_discount\":\"750\",\"discount_percent\":\"0.00\",\"purchase_price\":\"750.00\",\"purchase_line_tax_id\":null,\"item_tax\":\"0.00\",\"purchase_price_inc_tax\":\"750.00\",\"profit_percent\":\"33.33\",\"default_sell_price\":\"1,000.00\",\"mfg_date\":null,\"exp_date\":null,\"imei_numbers\":\"[]\",\"imei_count\":\"0\"}}"} 
[2026-09-12 17:01:06] live.ERROR: ETIMS settings not found for business ID: 43  
[2026-09-12 17:01:06] live.INFO: Purchase lines created {"transaction_id":1854,"purchase_lines_count":1,"purchase_lines":[{"id":1595,"transaction_id":1854,"product_id":165,"variation_id":166,"quantity":200.0,"secondary_unit_quantity":"0.0000","pp_without_discount":"750.0000","discount_percent":"0.00","purchase_price":"750.0000","purchase_price_inc_tax":"750.0000","item_tax":"0.0000","tax_id":null,"purchase_requisition_line_id":null,"purchase_order_line_id":null,"quantity_sold":"0.0000","quantity_adjusted":"0.0000","quantity_returned":"0.0000","po_quantity_purchased":"0.0000","mfg_quantity_used":"0.0000","mfg_date":null,"exp_date":null,"lot_number":null,"sub_unit_id":null,"created_at":"2026-09-12T14:01:06.000000Z","updated_at":"2026-09-12T14:01:06.000000Z"}]} 
[2026-09-12 17:01:06] live.INFO: Processing purchase row - 1 {"row_index":1,"product_id":"165","variation_id":"166","quantity":"200","has_imei":true,"imei_raw":"[]","purchase_data_keys":["product_id","variation_id","quantity","product_unit_id","sub_unit_id","pp_without_discount","discount_percent","purchase_price","purchase_line_tax_id","item_tax","purchase_price_inc_tax","profit_percent","default_sell_price","mfg_date","exp_date","imei_numbers","imei_count"]} 
[2026-09-12 17:01:06] live.INFO: IMEI Data - Parsed for row 1 {"row_index":1,"imei_count":0,"imei_data":[],"imei_json":"[]"} 
[2026-09-12 17:01:06] live.INFO: IMEI data is empty or invalid for row 1 {"imeiData":[]} 
[2026-09-12 17:01:06] live.INFO: M-Pesa sale evaluation {"is_mpesa_sale_raw":false,"is_valid_mpesa_sale":false,"payment_method_input":"cash","mpesa_transaction_id":null,"transaction_id":1854} 
[2026-09-12 17:01:06] live.INFO: Purchase created successfully with IMEI data {"transaction_id":1854,"ref_no":"PO2026/0017","final_total":150000.0} 
[2026-09-12 17:01:09] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 17:01:15] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 17:02:52] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 17:03:53] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 17:04:01] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 17:14:00] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 18:05:34] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 19:46:20] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 21:07:58] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-12 22:44:03] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
