[2026-09-07 08:18:53] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 08:28:55] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 08:38:57] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 08:49:00] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 08:59:00] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 09:08:52] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 09:19:01] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 09:30:10] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 09:32:42] live.INFO: === getOpeningClosingStock START === {"business_id":8,"date":"2026-09-06","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-07 09:32:42] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-06"} 
[2026-09-07 09:32:42] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-06')"} 
[2026-09-07 09:32:42] 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-06') ) * (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-06'))","bindings":["purchase_order",8,"opening_stock","opening_stock"]} 
[2026-09-07 09:32:42] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"148539703.97360000","is_opening":true,"date":"2026-09-06"} 
[2026-09-07 09:32:42] live.INFO: === getOpeningClosingStock START === {"business_id":8,"date":"2026-09-07","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-07 09:32:42] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-07' (includes all types except purchase_order)"} 
[2026-09-07 09:32:42] 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-07') ) * (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-07'","bindings":["purchase_order",8]} 
[2026-09-07 09:32:42] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"148539703.97360000","is_opening":false,"date":"2026-09-07"} 
[2026-09-07 09:32:55] 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-07 09:35:38] 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-07 09:39:00] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 09:40:43] live.INFO: === getOpeningClosingStock START === {"business_id":8,"date":"2026-09-06","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-07 09:40:43] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-06"} 
[2026-09-07 09:40:43] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-06')"} 
[2026-09-07 09:40:43] 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-06') ) * (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-06'))","bindings":["purchase_order",8,"opening_stock","opening_stock"]} 
[2026-09-07 09:40:43] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"148539703.97360000","is_opening":true,"date":"2026-09-06"} 
[2026-09-07 09:40:43] live.INFO: === getOpeningClosingStock START === {"business_id":8,"date":"2026-09-07","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-07 09:40:43] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-07' (includes all types except purchase_order)"} 
[2026-09-07 09:40:43] 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-07') ) * (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-07'","bindings":["purchase_order",8]} 
[2026-09-07 09:40:43] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"148539703.97360000","is_opening":false,"date":"2026-09-07"} 
[2026-09-07 09:49:10] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 09:59:50] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 10:08:57] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 10:13:03] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 10:13:22] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 10:14:21] live.INFO: filterProduct method called {"business_id":43,"search_term":"pa","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-07 10:14:21] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 10:14:21] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 10:14:21] live.DEBUG: Applying search filters {"search_term":"pa","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 10:14:21] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 10:14:21] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 10:14:21] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"pa"} 
[2026-09-07 10:14:21] live.INFO: Product Row Debug - RELOADED {"product_id":337,"product_name":"Panadol","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":15.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"249":{"unit_id":249,"unit_name":"tablets","unit_price":10.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-07 10:14:22] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:14:22] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:14:26] live.INFO: filterProduct method called {"business_id":43,"search_term":"pan","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-07 10:14:26] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 10:14:26] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 10:14:26] live.DEBUG: Applying search filters {"search_term":"pan","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 10:14:26] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 10:14:26] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 10:14:26] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"pan"} 
[2026-09-07 10:14:26] live.INFO: Product Row Debug - RELOADED {"product_id":337,"product_name":"Panadol","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":15.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"249":{"unit_id":249,"unit_name":"tablets","unit_price":10.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-07 10:14:27] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:14:27] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:14:27] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:14:27] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:14:40] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 10:15:09] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 10:15:54] live.INFO: filterProduct method called {"business_id":43,"search_term":"pan","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-07 10:15:54] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 10:15:54] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 10:15:54] live.DEBUG: Applying search filters {"search_term":"pan","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 10:15:54] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 10:15:54] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 10:15:54] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"pan"} 
[2026-09-07 10:15:55] live.INFO: Product Row Debug - RELOADED {"product_id":337,"product_name":"Panadol","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":15.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"249":{"unit_id":249,"unit_name":"tablets","unit_price":10.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-07 10:15:56] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:15:56] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:16:00] live.INFO: filterProduct method called {"business_id":43,"search_term":"pana","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-07 10:16:00] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 10:16:00] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 10:16:00] live.DEBUG: Applying search filters {"search_term":"pana","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 10:16:00] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 10:16:00] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 10:16:00] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"pana"} 
[2026-09-07 10:16:00] live.INFO: Product Row Debug - RELOADED {"product_id":337,"product_name":"Panadol","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":15.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"249":{"unit_id":249,"unit_name":"tablets","unit_price":10.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-07 10:16:01] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:16:01] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:16:02] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:16:02] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:16:14] live.INFO: filterProduct method called {"business_id":43,"search_term":"pa","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-07 10:16:14] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 10:16:14] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 10:16:14] live.DEBUG: Applying search filters {"search_term":"pa","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 10:16:14] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 10:16:14] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 10:16:14] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"pa"} 
[2026-09-07 10:16:15] live.INFO: Product Row Debug - RELOADED {"product_id":337,"product_name":"Panadol","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":15.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"249":{"unit_id":249,"unit_name":"tablets","unit_price":10.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-07 10:16:15] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:16:15] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:16:16] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:16:16] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:16:16] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:16:16] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:16:34] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 10:16:44] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 10:17:43] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 10:17:56] live.INFO: filterProduct method called {"business_id":43,"search_term":"pa","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-07 10:17:56] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 10:17:56] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 10:17:56] live.DEBUG: Applying search filters {"search_term":"pa","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 10:17:56] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 10:17:56] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 10:17:56] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"pa"} 
[2026-09-07 10:17:57] live.INFO: Product Row Debug - RELOADED {"product_id":337,"product_name":"Panadol","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":15.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"249":{"unit_id":249,"unit_name":"tablets","unit_price":10.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-07 10:17:59] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:17:59] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:18:02] live.INFO: filterProduct method called {"business_id":43,"search_term":"oa","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-07 10:18:02] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 10:18:02] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 10:18:02] live.DEBUG: Applying search filters {"search_term":"oa","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 10:18:02] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 10:18:02] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 10:18:02] live.INFO: filterProduct completed successfully {"result_count":0,"business_id":43,"search_term":"oa"} 
[2026-09-07 10:18:08] live.INFO: filterProduct method called {"business_id":43,"search_term":"pa","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-07 10:18:08] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 10:18:08] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 10:18:08] live.DEBUG: Applying search filters {"search_term":"pa","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 10:18:08] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 10:18:08] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 10:18:08] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"pa"} 
[2026-09-07 10:18:08] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:18:08] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:18:09] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:18:09] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:18:09] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:18:09] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:18:10] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 10:18:10] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 10:29:37] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 10:30:06] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2025-12-31","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":"all"} 
[2026-09-07 10:30:06] live.INFO: Opening stock calculation - including all transactions {"date":"2025-12-31"} 
[2026-09-07 10:30:06] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2025-12-31')"} 
[2026-09-07 10:30:06] 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) <= '2025-12-31') ) * (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) <= '2025-12-31'))","bindings":["purchase_order",43,"opening_stock","opening_stock"]} 
[2026-09-07 10:30:06] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"2676665.08000000","is_opening":true,"date":"2025-12-31"} 
[2026-09-07 10:30:06] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-12-31","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":"all"} 
[2026-09-07 10:30:06] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-12-31' (includes all types except purchase_order)"} 
[2026-09-07 10:30:06] 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-12-31') ) * (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-12-31'","bindings":["purchase_order",43]} 
[2026-09-07 10:30:06] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"6708032.43600000","is_opening":false,"date":"2026-12-31"} 
[2026-09-07 10:30:06] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 10:30:07] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2025-12-31","location_id":null,"is_opening":true,"by_sale_price":true,"filters":"all","permitted_locations":null} 
[2026-09-07 10:30:07] live.DEBUG: Using sale price instead of purchase price {"price_query_part":"v.sell_price_inc_tax"} 
[2026-09-07 10:30:07] live.INFO: Opening stock calculation - including all transactions {"date":"2025-12-31"} 
[2026-09-07 10:30:07] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2025-12-31')"} 
[2026-09-07 10:30:07] 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) <= '2025-12-31') ) * v.sell_price_inc_tax
                    ) 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) <= '2025-12-31'))","bindings":["purchase_order",43,"opening_stock","opening_stock"]} 
[2026-09-07 10:30:07] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"4053225.00000000","is_opening":true,"date":"2025-12-31"} 
[2026-09-07 10:30:07] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-12-31","location_id":null,"is_opening":false,"by_sale_price":true,"filters":"all","permitted_locations":null} 
[2026-09-07 10:30:07] live.DEBUG: Using sale price instead of purchase price {"price_query_part":"v.sell_price_inc_tax"} 
[2026-09-07 10:30:07] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-12-31' (includes all types except purchase_order)"} 
[2026-09-07 10:30:07] 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-12-31') ) * v.sell_price_inc_tax
                    ) 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-12-31'","bindings":["purchase_order",43]} 
[2026-09-07 10:30:07] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"6365795.00000000","is_opening":false,"date":"2026-12-31"} 
[2026-09-07 10:33:15] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-06","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":"all"} 
[2026-09-07 10:33:15] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-06"} 
[2026-09-07 10:33:15] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-06')"} 
[2026-09-07 10:33:15] 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-06') ) * (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-06'))","bindings":["purchase_order",43,"opening_stock","opening_stock"]} 
[2026-09-07 10:33:15] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"6708032.43600000","is_opening":true,"date":"2026-09-06"} 
[2026-09-07 10:33:15] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-07","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":"all"} 
[2026-09-07 10:33:15] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-07' (includes all types except purchase_order)"} 
[2026-09-07 10:33:15] 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-07') ) * (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-07'","bindings":["purchase_order",43]} 
[2026-09-07 10:33:15] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"6708032.43600000","is_opening":false,"date":"2026-09-07"} 
[2026-09-07 10:33:15] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-06","location_id":null,"is_opening":true,"by_sale_price":true,"filters":"all","permitted_locations":null} 
[2026-09-07 10:33:15] live.DEBUG: Using sale price instead of purchase price {"price_query_part":"v.sell_price_inc_tax"} 
[2026-09-07 10:33:15] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-06"} 
[2026-09-07 10:33:15] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-06')"} 
[2026-09-07 10:33:15] 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-06') ) * v.sell_price_inc_tax
                    ) 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-06'))","bindings":["purchase_order",43,"opening_stock","opening_stock"]} 
[2026-09-07 10:33:15] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"6365795.00000000","is_opening":true,"date":"2026-09-06"} 
[2026-09-07 10:33:15] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-07","location_id":null,"is_opening":false,"by_sale_price":true,"filters":"all","permitted_locations":null} 
[2026-09-07 10:33:15] live.DEBUG: Using sale price instead of purchase price {"price_query_part":"v.sell_price_inc_tax"} 
[2026-09-07 10:33:15] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-07' (includes all types except purchase_order)"} 
[2026-09-07 10:33:15] 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-07') ) * v.sell_price_inc_tax
                    ) 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-07'","bindings":["purchase_order",43]} 
[2026-09-07 10:33:15] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"6365795.00000000","is_opening":false,"date":"2026-09-07"} 
[2026-09-07 10:40:09] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 10:50:10] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 11:00:10] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 11:10:10] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 11:12:28] live.INFO: filterProduct method called {"business_id":43,"search_term":"Pa","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-07 11:12:28] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 11:12:28] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 11:12:28] live.DEBUG: Applying search filters {"search_term":"Pa","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 11:12:28] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 11:12:28] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 11:12:28] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"Pa"} 
[2026-09-07 11:12:29] live.INFO: Product Row Debug - RELOADED {"product_id":337,"product_name":"Panadol","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":15.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"249":{"unit_id":249,"unit_name":"tablets","unit_price":10.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-07 11:12:30] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 11:12:30] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 11:12:36] live.INFO: Credit Limit Check Started {"contact_id":"703","status":"final","final_total":"10.00","is_credit_sale":"0","exclude_transaction_id":null} 
[2026-09-07 11:12:36] live.DEBUG: Payment Calculation {"final_total":10.0,"curr_total_payment":15.0,"is_credit_sale":false,"payment_count":1} 
[2026-09-07 11:12:36] live.INFO: Credit Limit Check Skipped - Fully Paid {"final_total":10.0,"curr_total_payment":15.0} 
[2026-09-07 11:12:36] live.INFO: mpesa_transaction_id value: NULL  
[2026-09-07 11:12:36] live.INFO: is_mpesa_sale value: true  
[2026-09-07 11:12:36] 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":1822} 
[2026-09-07 11:12:36] live.INFO: Journal Entry Case: FULL CASH PAYMENT {"transaction_id":1822,"final_total":10.0,"amount_paid":15.0,"balance_due":0} 
[2026-09-07 11:12:36] live.INFO: Journal Entries Inserted Successfully {"transaction_id":1822,"entries":[{"transaction_id":1822,"created_by_id":293,"transaction_number":"TRX-6a9e71f4e684c6.77317731","payment_detail_id":1304,"location_id":"39","currency_id":133,"transaction_type":"sell","date":"2026-09-07","month":9,"year":2026,"active":1,"reversed":0,"reversible":1,"manual_entry":1,"created_at":"2026-09-07 11:12:36","updated_at":"2026-09-07 11:12:36","chart_of_account_id":15441,"debit":null,"credit":10.0},{"transaction_id":1822,"created_by_id":293,"transaction_number":"TRX-6a9e71f4e684c6.77317731","payment_detail_id":1304,"location_id":"39","currency_id":133,"transaction_type":"sell","date":"2026-09-07","month":9,"year":2026,"active":1,"reversed":0,"reversible":1,"manual_entry":1,"created_at":"2026-09-07 11:12:36","updated_at":"2026-09-07 11:12:36","chart_of_account_id":15445,"debit":10.0,"credit":null}]} 
[2026-09-07 11:12:37] live.INFO: Inserted purchase sell mapping {"count":1,"data":[{"sell_line_id":1165,"purchase_line_id":1569,"quantity":1.0,"created_at":"2026-09-07 11:12:37","updated_at":"2026-09-07 11:12:37"}]} 
[2026-09-07 11:12:37] live.INFO: Inserted COGS → Inventory journal entries {"count":2} 
[2026-09-07 11:12:37] live.INFO: Inserted Retained Earnings (profit) entries {"count":1,"total_profit":5.0} 
[2026-09-07 11:12:37] live.ERROR: ETIMS settings not found for business ID: 43  
[2026-09-07 11:12:37] live.WARNING: ETIMS WAIT: Timed out after 2 attempts for transaction ID: 1822  
[2026-09-07 11:12:52] live.INFO: filterProduct method called {"business_id":43,"search_term":"pa","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-07 11:12:52] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 11:12:52] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 11:12:52] live.DEBUG: Applying search filters {"search_term":"pa","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 11:12:52] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 11:12:52] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 11:12:52] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"pa"} 
[2026-09-07 11:12:53] live.INFO: Product Row Debug - RELOADED {"product_id":337,"product_name":"Panadol","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":15.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"249":{"unit_id":249,"unit_name":"tablets","unit_price":10.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-07 11:12:53] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 11:12:53] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 11:13:06] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 11:13:06] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 11:13:07] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 11:13:07] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 11:13:21] live.INFO: filterProduct method called {"business_id":43,"search_term":"pan","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-07 11:13:21] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 11:13:21] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 11:13:21] live.DEBUG: Applying search filters {"search_term":"pan","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 11:13:21] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 11:13:21] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 11:13:21] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"pan"} 
[2026-09-07 11:13:23] live.INFO: Product Row Debug - RELOADED {"product_id":337,"product_name":"Panadol","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":15.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"249":{"unit_id":249,"unit_name":"tablets","unit_price":10.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-07 11:13:24] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 11:13:24] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 11:13:39] 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-07 11:13:39] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 11:13:39] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 11:13:39] live.DEBUG: Applying search filters {"search_term":"milk","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 11:13:39] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 11:13:39] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 11:13:39] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"milk"} 
[2026-09-07 11:13:39] 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-07 11:13:57] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 11:14:04] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 11:14:38] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 11:15:07] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 11:15:13] live.INFO: filterProduct method called {"business_id":43,"search_term":"pan","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-07 11:15:13] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 11:15:13] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 11:15:13] live.DEBUG: Applying search filters {"search_term":"pan","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 11:15:13] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 11:15:13] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 11:15:13] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"pan"} 
[2026-09-07 11:15:13] live.INFO: Product Row Debug - RELOADED {"product_id":337,"product_name":"Panadol","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":15.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"249":{"unit_id":249,"unit_name":"tablets","unit_price":10.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-07 11:15:14] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 11:15:14] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 11:42:12] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 11:42:27] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 11:43:16] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 11:52:38] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 11:53:51] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 11:55:12] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:01:39] live.INFO: filterProduct method called {"business_id":43,"search_term":"panad","location_id":"39","not_for_selling":"0","price_group_id":"0","product_types":[],"search_fields":["name","sku","serial_number"],"check_qty":false,"search_type":"like"} 
[2026-09-07 12:01:39] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:01:39] live.DEBUG: Joining product_serial_numbers table for serial number search  
[2026-09-07 12:01:39] live.DEBUG: Serial numbers filtered by location {"location_id":"39"} 
[2026-09-07 12:01:39] live.DEBUG: Joining transaction_sell_lines and transactions to check if serial number is sold  
[2026-09-07 12:01:39] live.DEBUG: Added condition: keep products without serial numbers OR with available quantity > 0  
[2026-09-07 12:01:39] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:01:39] live.DEBUG: Applying search filters {"search_term":"panad","search_type":"like","search_fields":["name","sku","serial_number"]} 
[2026-09-07 12:01:39] live.DEBUG: LIKE search conditions applied {"fields":["name","sku","serial_number"]} 
[2026-09-07 12:01:39] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:01:39] live.DEBUG: Added serial number, quantity, and transaction sell line fields with quantity details to select  
[2026-09-07 12:01:39] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"panad"} 
[2026-09-07 12:01:43] 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-07 12:01:43] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:01:43] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:01:43] live.DEBUG: Applying search filters {"search_term":"milk","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:01:43] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:01:43] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:01:43] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"milk"} 
[2026-09-07 12:01:47] 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-07 12:01:58] 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-07 12:01:58] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:01:58] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:01:58] live.DEBUG: Applying search filters {"search_term":"milk","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:01:58] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:01:58] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:01:58] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"milk"} 
[2026-09-07 12:02:04] 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-07 12:02:25] live.INFO: filterProduct method called {"business_id":43,"search_term":"pana","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-07 12:02:25] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:02:25] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:02:25] live.DEBUG: Applying search filters {"search_term":"pana","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:02:25] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:02:25] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:02:25] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"pana"} 
[2026-09-07 12:02:31] live.INFO: Product Row Debug - RELOADED {"product_id":337,"product_name":"Panadol","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":15.0,"discounts_json":"[]","multiplier":1,"unit_prices":{"249":{"unit_id":249,"unit_name":"tablets","unit_price":10.0,"multiplier":1,"has_price":true}},"has_price_group":false,"price_group_id":null} 
[2026-09-07 12:02:35] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 12:02:35] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 12:02:36] live.INFO: filterProduct method called {"business_id":43,"search_term":"our","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-07 12:02:36] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:02:36] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:02:36] live.DEBUG: Applying search filters {"search_term":"our","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:02:36] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:02:36] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:02:36] live.INFO: filterProduct completed successfully {"result_count":3,"business_id":43,"search_term":"our"} 
[2026-09-07 12:02:38] live.INFO: filterProduct method called {"business_id":43,"search_term":"four","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-07 12:02:38] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:02:38] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:02:38] live.DEBUG: Applying search filters {"search_term":"four","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:02:38] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:02:38] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:02:38] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"four"} 
[2026-09-07 12:02:40] live.INFO: Product Row Debug - RELOADED {"product_id":165,"product_name":"four cousins 750ml","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":1000.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-07 12:02:42] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 12:02:42] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 12:02:43] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 12:02:43] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 12:02:44] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 12:02:44] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 12:02:45] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 12:02:45] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 12:02:46] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 12:02:46] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 12:02:48] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 12:02:48] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 12:02:49] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 12:02:49] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 12:02:50] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 12:02:50] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 12:02:51] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 12:02:51] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 12:02:56] live.INFO: filterProduct method called {"business_id":43,"search_term":"ra","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-07 12:02:56] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:02:56] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:02:56] live.DEBUG: Applying search filters {"search_term":"ra","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:02:56] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:02:56] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:02:56] live.INFO: filterProduct completed successfully {"result_count":0,"business_id":43,"search_term":"ra"} 
[2026-09-07 12:03:44] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 12:03:44] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 12:03:44] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 12:03:44] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 12:03:45] live.INFO: Fetching tax rate for product ID: 337  
[2026-09-07 12:03:45] live.INFO: Product ID 337 has no tax assigned.  
[2026-09-07 12:03:51] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:04:11] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:08:11] live.INFO: filterProduct method called {"business_id":43,"search_term":"four","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-07 12:08:11] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:08:11] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:08:11] live.DEBUG: Applying search filters {"search_term":"four","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:08:11] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:08:11] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:08:11] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"four"} 
[2026-09-07 12:08:12] live.INFO: Product Row Debug - RELOADED {"product_id":165,"product_name":"four cousins 750ml","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":1000.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-07 12:08:24] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:08:36] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:08:49] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:09:17] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:10:09] live.INFO: filterProduct method called {"business_id":43,"search_term":"fo","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-07 12:10:09] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:10:09] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:10:09] live.DEBUG: Applying search filters {"search_term":"fo","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:10:09] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:10:09] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:10:09] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"fo"} 
[2026-09-07 12:10:09] live.INFO: Product Row Debug - RELOADED {"product_id":165,"product_name":"four cousins 750ml","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":1000.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-07 12:10:20] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:10:27] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:10:55] live.INFO: filterProduct method called {"business_id":43,"search_term":"fou","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-07 12:10:55] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:10:55] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:10:55] live.DEBUG: Applying search filters {"search_term":"fou","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:10:55] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:10:55] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:10:55] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"fou"} 
[2026-09-07 12:10:56] live.INFO: Product Row Debug - RELOADED {"product_id":165,"product_name":"four cousins 750ml","discount_allowed":false,"has_global_discount":false,"global_discount_type":"fixed","global_discount_amount":0,"discounts_count":0,"discounts":[],"base_price":1000.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-07 12:11:04] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:11:09] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:11:32] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:12:31] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:12:53] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:13:30] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:16:11] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:16:27] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:20:38] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:20:52] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:21:07] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:21:23] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:22:54] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:23:37] live.INFO: filterProduct method called {"business_id":43,"search_term":"fou","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-07 12:23:37] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:23:37] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:23:37] live.DEBUG: Applying search filters {"search_term":"fou","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:23:37] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:23:37] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:23:37] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"fou"} 
[2026-09-07 12:23:37] live.INFO: Product Row Debug - RELOADED {"product_id":165,"product_name":"four cousins 750ml","discount_allowed":true,"has_global_discount":true,"global_discount_type":"fixed","global_discount_amount":"100.0000","discounts_count":0,"discounts":[],"base_price":1000.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-07 12:23:39] live.INFO: getProductDiscounts called {"product_id":"165"} 
[2026-09-07 12:23:39] live.INFO: Product found {"product_id":165,"product_name":null,"discount_allowed":false} 
[2026-09-07 12:23:39] live.INFO: Discounts found {"product_id":"165","count":0,"discounts":[]} 
[2026-09-07 12:23:48] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:23:52] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:24:59] live.INFO: filterProduct method called {"business_id":43,"search_term":"fou","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-07 12:24:59] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:24:59] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:24:59] live.DEBUG: Applying search filters {"search_term":"fou","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:24:59] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:24:59] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:24:59] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"fou"} 
[2026-09-07 12:25:00] live.INFO: Product Row Debug - RELOADED {"product_id":165,"product_name":"four cousins 750ml","discount_allowed":true,"has_global_discount":true,"global_discount_type":"fixed","global_discount_amount":"150.0000","discounts_count":0,"discounts":[],"base_price":1000.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-07 12:25:01] live.INFO: getProductDiscounts called {"product_id":"165"} 
[2026-09-07 12:25:01] live.INFO: Product found {"product_id":165,"product_name":null,"discount_allowed":false} 
[2026-09-07 12:25:01] live.INFO: Discounts found {"product_id":"165","count":0,"discounts":[]} 
[2026-09-07 12:25:08] live.INFO: Credit Limit Check Started {"contact_id":"703","status":"final","final_total":"1000.00","is_credit_sale":"0","exclude_transaction_id":null} 
[2026-09-07 12:25:08] live.DEBUG: Payment Calculation {"final_total":1000.0,"curr_total_payment":1000.0,"is_credit_sale":false,"payment_count":1} 
[2026-09-07 12:25:08] live.INFO: Credit Limit Check Skipped - Fully Paid {"final_total":1000.0,"curr_total_payment":1000.0} 
[2026-09-07 12:25:08] live.INFO: mpesa_transaction_id value: NULL  
[2026-09-07 12:25:08] live.INFO: is_mpesa_sale value: true  
[2026-09-07 12:25:08] 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":1823} 
[2026-09-07 12:25:08] live.INFO: Journal Entry Case: FULL CASH PAYMENT {"transaction_id":1823,"final_total":1000.0,"amount_paid":1000.0,"balance_due":0} 
[2026-09-07 12:25:08] live.INFO: Journal Entries Inserted Successfully {"transaction_id":1823,"entries":[{"transaction_id":1823,"created_by_id":293,"transaction_number":"TRX-6a9e82f490acb0.13678819","payment_detail_id":1305,"location_id":"39","currency_id":133,"transaction_type":"sell","date":"2026-09-07","month":9,"year":2026,"active":1,"reversed":0,"reversible":1,"manual_entry":1,"created_at":"2026-09-07 12:25:08","updated_at":"2026-09-07 12:25:08","chart_of_account_id":15441,"debit":null,"credit":1000.0},{"transaction_id":1823,"created_by_id":293,"transaction_number":"TRX-6a9e82f490acb0.13678819","payment_detail_id":1305,"location_id":"39","currency_id":133,"transaction_type":"sell","date":"2026-09-07","month":9,"year":2026,"active":1,"reversed":0,"reversible":1,"manual_entry":1,"created_at":"2026-09-07 12:25:08","updated_at":"2026-09-07 12:25:08","chart_of_account_id":15445,"debit":1000.0,"credit":null}]} 
[2026-09-07 12:25:08] live.INFO: Inserted purchase sell mapping {"count":1,"data":[{"sell_line_id":1166,"purchase_line_id":1313,"quantity":1.0,"created_at":"2026-09-07 12:25:08","updated_at":"2026-09-07 12:25:08"}]} 
[2026-09-07 12:25:08] live.INFO: Inserted COGS → Inventory journal entries {"count":2} 
[2026-09-07 12:25:08] live.INFO: Inserted Retained Earnings (profit) entries {"count":1,"total_profit":300.0} 
[2026-09-07 12:25:08] live.ERROR: ETIMS settings not found for business ID: 43  
[2026-09-07 12:25:08] live.WARNING: ETIMS WAIT: Timed out after 2 attempts for transaction ID: 1823  
[2026-09-07 12:25:20] live.INFO: filterProduct method called {"business_id":43,"search_term":"fou","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-07 12:25:20] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:25:20] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:25:20] live.DEBUG: Applying search filters {"search_term":"fou","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:25:20] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:25:20] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:25:20] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"fou"} 
[2026-09-07 12:25:21] live.INFO: Product Row Debug - RELOADED {"product_id":165,"product_name":"four cousins 750ml","discount_allowed":true,"has_global_discount":true,"global_discount_type":"fixed","global_discount_amount":"150.0000","discounts_count":0,"discounts":[],"base_price":1000.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-07 12:25:22] live.INFO: getProductDiscounts called {"product_id":"165"} 
[2026-09-07 12:25:22] live.INFO: Product found {"product_id":165,"product_name":null,"discount_allowed":false} 
[2026-09-07 12:25:22] live.INFO: Discounts found {"product_id":"165","count":0,"discounts":[]} 
[2026-09-07 12:25:49] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:25:53] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:26:06] live.INFO: filterProduct method called {"business_id":43,"search_term":"fou","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-07 12:26:06] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:26:06] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:26:06] live.DEBUG: Applying search filters {"search_term":"fou","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:26:06] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:26:06] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:26:06] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"fou"} 
[2026-09-07 12:26:07] live.INFO: Product Row Debug - RELOADED {"product_id":165,"product_name":"four cousins 750ml","discount_allowed":true,"has_global_discount":true,"global_discount_type":"fixed","global_discount_amount":"150.0000","discounts_count":0,"discounts":[],"base_price":1000.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-07 12:26:08] live.INFO: getProductDiscounts called {"product_id":"165"} 
[2026-09-07 12:26:08] live.INFO: Product found {"product_id":165,"product_name":null,"discount_allowed":false} 
[2026-09-07 12:26:08] live.INFO: Discounts found {"product_id":"165","count":0,"discounts":[]} 
[2026-09-07 12:31:40] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:31:45] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:32:05] live.INFO: filterProduct method called {"business_id":43,"search_term":"fou","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-07 12:32:05] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 12:32:05] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 12:32:05] live.DEBUG: Applying search filters {"search_term":"fou","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 12:32:05] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 12:32:05] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 12:32:05] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"fou"} 
[2026-09-07 12:32:06] live.INFO: Product Row Debug - RELOADED {"product_id":165,"product_name":"four cousins 750ml","discount_allowed":true,"has_global_discount":true,"global_discount_type":"fixed","global_discount_amount":"150.0000","discounts_count":0,"discounts":[],"base_price":1000.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-07 12:32:06] live.INFO: getProductDiscounts called {"product_id":"165"} 
[2026-09-07 12:32:06] live.INFO: Product found {"product_id":165,"product_name":null,"discount_allowed":false} 
[2026-09-07 12:32:06] live.INFO: Discounts found {"product_id":"165","count":0,"discounts":[]} 
[2026-09-07 12:44:54] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:44:58] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:47:13] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:47:41] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:47:54] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:48:03] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:50:57] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 12:51:06] live.WARNING: ETIMS WAIT: Timed out after 2 attempts for transaction ID: 1823  
[2026-09-07 12:51:44] live.WARNING: ETIMS WAIT: Timed out after 2 attempts for transaction ID: 1823  
[2026-09-07 12:52:29] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 13:02:28] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 13:12:28] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 13:22:28] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 13:32:28] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 13:40:58] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 13:45:31] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 13:47:19] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-06","location_id":null,"is_opening":true,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-07 13:47:19] live.INFO: Opening stock calculation - including all transactions {"date":"2026-09-06"} 
[2026-09-07 13:47:19] live.INFO: Applied opening stock condition {"condition":"purchase.type = 'opening_stock' OR (purchase.type != 'opening_stock' AND date(transaction_date) <= '2026-09-06')"} 
[2026-09-07 13:47:19] 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-06') ) * (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-06'))","bindings":["purchase_order",43,"opening_stock","opening_stock"]} 
[2026-09-07 13:47:19] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"6708032.43600000","is_opening":true,"date":"2026-09-06"} 
[2026-09-07 13:47:19] live.INFO: === getOpeningClosingStock START === {"business_id":43,"date":"2026-09-07","location_id":null,"is_opening":false,"by_sale_price":false,"filters":{"user_id":null},"permitted_locations":null} 
[2026-09-07 13:47:19] live.INFO: Applied closing stock condition {"condition":"date(transaction_date) <= '2026-09-07' (includes all types except purchase_order)"} 
[2026-09-07 13:47:19] 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-07') ) * (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-07'","bindings":["purchase_order",43]} 
[2026-09-07 13:47:19] live.INFO: === getOpeningClosingStock RESULT === {"calculated_stock":"6707327.43600000","is_opening":false,"date":"2026-09-07"} 
[2026-09-07 13:47:20] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 13:51:04] live.INFO: filterProduct method called {"business_id":43,"search_term":"fou","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-07 13:51:04] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 13:51:04] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 13:51:04] live.DEBUG: Applying search filters {"search_term":"fou","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 13:51:04] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 13:51:04] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 13:51:04] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"fou"} 
[2026-09-07 13:51:06] live.INFO: Product Row Debug - RELOADED {"product_id":165,"product_name":"four cousins 750ml","discount_allowed":true,"has_global_discount":true,"global_discount_type":"fixed","global_discount_amount":"150.0000","discounts_count":0,"discounts":[],"base_price":1000.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-07 13:51:08] live.INFO: getProductDiscounts called {"product_id":"165"} 
[2026-09-07 13:51:08] live.INFO: Product found {"product_id":165,"product_name":null,"discount_allowed":false} 
[2026-09-07 13:51:08] live.INFO: Discounts found {"product_id":"165","count":0,"discounts":[]} 
[2026-09-07 13:59:33] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 14:09:32] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 14:19:47] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 14:29:33] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 14:39:42] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 14:49:51] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 14:59:32] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 15:10:20] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 15:18:55] live.INFO: filterProduct method called {"business_id":43,"search_term":"fou","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-07 15:18:55] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 15:18:55] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 15:18:55] live.DEBUG: Applying search filters {"search_term":"fou","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 15:18:55] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 15:18:55] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 15:18:55] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"fou"} 
[2026-09-07 15:18:56] live.INFO: Product Row Debug - RELOADED {"product_id":165,"product_name":"four cousins 750ml","discount_allowed":true,"has_global_discount":true,"global_discount_type":"fixed","global_discount_amount":"150.0000","discounts_count":0,"discounts":[],"base_price":1000.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-07 15:18:58] live.INFO: getProductDiscounts called {"product_id":"165"} 
[2026-09-07 15:18:58] live.INFO: Product found {"product_id":165,"product_name":null,"discount_allowed":false} 
[2026-09-07 15:18:58] live.INFO: Discounts found {"product_id":"165","count":0,"discounts":[]} 
[2026-09-07 15:19:13] live.INFO: Credit Limit Check Started {"contact_id":"703","status":"final","final_total":"1000.00","is_credit_sale":"0","exclude_transaction_id":null} 
[2026-09-07 15:19:13] live.DEBUG: Payment Calculation {"final_total":1000.0,"curr_total_payment":1000.0,"is_credit_sale":false,"payment_count":1} 
[2026-09-07 15:19:13] live.INFO: Credit Limit Check Skipped - Fully Paid {"final_total":1000.0,"curr_total_payment":1000.0} 
[2026-09-07 15:19:13] live.INFO: mpesa_transaction_id value: NULL  
[2026-09-07 15:19:13] live.INFO: is_mpesa_sale value: true  
[2026-09-07 15:19:13] 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":1824} 
[2026-09-07 15:19:13] live.INFO: Journal Entry Case: FULL CASH PAYMENT {"transaction_id":1824,"final_total":1000.0,"amount_paid":1000.0,"balance_due":0} 
[2026-09-07 15:19:13] live.INFO: Journal Entries Inserted Successfully {"transaction_id":1824,"entries":[{"transaction_id":1824,"created_by_id":293,"transaction_number":"TRX-6a9eabc1626907.55325916","payment_detail_id":1306,"location_id":"39","currency_id":133,"transaction_type":"sell","date":"2026-09-07","month":9,"year":2026,"active":1,"reversed":0,"reversible":1,"manual_entry":1,"created_at":"2026-09-07 15:19:13","updated_at":"2026-09-07 15:19:13","chart_of_account_id":15441,"debit":null,"credit":1000.0},{"transaction_id":1824,"created_by_id":293,"transaction_number":"TRX-6a9eabc1626907.55325916","payment_detail_id":1306,"location_id":"39","currency_id":133,"transaction_type":"sell","date":"2026-09-07","month":9,"year":2026,"active":1,"reversed":0,"reversible":1,"manual_entry":1,"created_at":"2026-09-07 15:19:13","updated_at":"2026-09-07 15:19:13","chart_of_account_id":15445,"debit":1000.0,"credit":null}]} 
[2026-09-07 15:19:13] live.INFO: Inserted purchase sell mapping {"count":1,"data":[{"sell_line_id":1167,"purchase_line_id":1313,"quantity":1.0,"created_at":"2026-09-07 15:19:13","updated_at":"2026-09-07 15:19:13"}]} 
[2026-09-07 15:19:13] live.INFO: Inserted COGS → Inventory journal entries {"count":2} 
[2026-09-07 15:19:13] live.INFO: Inserted Retained Earnings (profit) entries {"count":1,"total_profit":300.0} 
[2026-09-07 15:19:13] live.ERROR: ETIMS settings not found for business ID: 43  
[2026-09-07 15:19:13] live.WARNING: ETIMS WAIT: Timed out after 2 attempts for transaction ID: 1824  
[2026-09-07 15:19:44] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 15:19:51] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 15:20:30] live.INFO: filterProduct method called {"business_id":43,"search_term":"fou","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-07 15:20:30] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 15:20:30] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 15:20:30] live.DEBUG: Applying search filters {"search_term":"fou","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 15:20:30] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 15:20:30] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 15:20:30] live.INFO: filterProduct completed successfully {"result_count":1,"business_id":43,"search_term":"fou"} 
[2026-09-07 15:20:38] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 15:21:07] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 15:22:54] live.INFO: filterProduct method called {"business_id":43,"search_term":"un","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-07 15:22:54] live.DEBUG: Initial query built with joins {"has_location":true} 
[2026-09-07 15:22:54] live.DEBUG: Filtering by not_for_selling {"not_for_selling":"0"} 
[2026-09-07 15:22:54] live.DEBUG: Applying search filters {"search_term":"un","search_type":"like","search_fields":["name","sku"]} 
[2026-09-07 15:22:54] live.DEBUG: LIKE search conditions applied {"fields":["name","sku"]} 
[2026-09-07 15:22:54] live.DEBUG: Applying location filter {"location_id":"39"} 
[2026-09-07 15:22:54] live.INFO: filterProduct completed successfully {"result_count":3,"business_id":43,"search_term":"un"} 
[2026-09-07 15:23:05] live.INFO: Product Row Debug - RELOADED {"product_id":176,"product_name":"unga floor 500g","discount_allowed":true,"has_global_discount":true,"global_discount_type":"fixed","global_discount_amount":"150.0000","discounts_count":0,"discounts":[],"base_price":100.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-07 15:23:06] live.INFO: getProductDiscounts called {"product_id":"176"} 
[2026-09-07 15:23:06] live.INFO: Product found {"product_id":176,"product_name":null,"discount_allowed":false} 
[2026-09-07 15:23:06] live.INFO: Discounts found {"product_id":"176","count":0,"discounts":[]} 
[2026-09-07 15:24:57] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 15:35:01] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 15:45:00] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 15:55:00] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 16:05:00] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 16:15:03] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 16:24:59] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 16:35:10] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 16:44:59] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
[2026-09-07 16:54:55] live.INFO: Offline not allowed - triggering cleanup {"user_id":293,"business_id":43} 
